Call update when editor window opens
Call update when editor window opens
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]
[code]
$('select', editor.node('LOB')).on('change', function () {
//Call this when the editor window opens
editor.field('ExposureTypeDescription').update(loadExposureType(editor.get('LOB')));
});
[/code]
This discussion has been closed.
Replies
I added an event to $.fn.dataTable.Editor
"events": {
"onInitEdit": function (json, data) {
editor.field('ExposureTypeDescription').update(loadExposureType(editor.get('LOB')));
}
}
You beat me to it - yes - onInitEdit (and its friend onInitCreate) will be the way to do this.
Nice one :-)
Allan