I have a field with a combobox editor (the field is in a databgird).
I use the onBeforeLoad function in order to populate the content on the combox (the data is read from another datagrid).
Here is the code:
Code:
{field:'Jptask',title:'Op',width:10,
editor: {
type: 'combobox',
options: {
onBeforeLoad:function() {
var rows = $('#dg_Jobtask').datagrid('getRows');
var json = [];
for (var i=0; i<rows.length; i++) {
json.push({ id: rows[i].Jptask, text: rows[i].Jptask })
}
$(this).combobox('loadData', json);
}
}
}
},
All work as expected.
The only problem is that the onBeforeLoad function is executed only the first time when the user click on the combobox.
Is it possible to execute this function every time when the user click on the combobox ?
Thanks in advance for any help.
Miche