Call update when editor window opens

Call update when editor window opens

cbp8092cbp8092 Posts: 14Questions: 1Answers: 0
edited October 2013 in Editor
I'm working on building out cascading selects on edit. Take a look at the code below. I want to call editor.field('ExposureTypeDescription').update(loadExposureType(editor.get('LOB'))); when the editor window opens not when a select option is changed.

[code]
$('select', editor.node('LOB')).on('change', function () {
//Call this when the editor window opens
editor.field('ExposureTypeDescription').update(loadExposureType(editor.get('LOB')));
});
[/code]

Replies

  • cbp8092cbp8092 Posts: 14Questions: 1Answers: 0
    I figured this out.

    I added an event to $.fn.dataTable.Editor

    "events": {
    "onInitEdit": function (json, data) {
    editor.field('ExposureTypeDescription').update(loadExposureType(editor.get('LOB')));
    }
    }
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi,

    You beat me to it - yes - onInitEdit (and its friend onInitCreate) will be the way to do this.

    Nice one :-)

    Allan
This discussion has been closed.