I have done following coding :
onBeginEdit: function(index,row){
var field = 'trgdate';
var ed = $(this).datagrid('getEditor', {index:index,field:field});
$(ed.target).combobox({
value: row[field],
url: 'rating.getPlan.php?yr='+yr+'&trgcode='+row.trgcode,
onLoadSuccess: function(data){
// alert(data.length);
if (data.length == 0) {
// var colDate = $(this).datagrid('getColumnOption', 'trgdate');
// colDate.editor = 'datebox';
$(ed.target).editor = 'datebox';
}
}
});
},But this does not work, although no. of rows populated in combobox (data.length) can be access easily. Problem is that I cannot change the editor type of that cell from combobox to datebox. Perhaps, this cannot be possible within beginEdit event, because already editing is going on, perhaps have to make endEdit first, then have to change editor type to datebox and again have to invoke beginEdit. Better to invoke the same routine in another event like BeforeEdit or something else custom made.