Hi Jarry,
Thanks alot for your reply, maybe you misunderstood my point, I'm sorry about my question, I mean that
when I want to edit the current row by double-clicking the row, the editor will automatically change into checkbox if row.key_editor = 2, and if row.key_editor = 3 into the textbox and so on, I try using onBeginEdit event
var myTextEditor = {
type:'textbox',
options:{
icons:[{
iconCls: 'icon-new-win',
handler:function(e){
var row = $('#dgKeyVal').datagrid('getSelected');
if(row.key_map=='LOGO'){
//alert('Attach logo !');
openDlgAttachFile();
}else{
valMore();
}
}
}],
}
};
var myCheckEditor = {
type:'checkbox',
options: {on:1,off:0},
};
// this is my column
{field: 'key_map', title: 'Key', width: 100, sortable: true},
{field: 'val_map', title: 'Value', editor: myTextEditor }, <<---- Change this editor
{field: 'key_editor', hidden: true},
onBeginEdit: function(index,row){
if(row.key_editor==2){
//change val_map to checkbox editor
console.log('checkbox');
// this should be change to myCheckEditor
}else{
console.log('textbox');
// this should be change to myTextEditor
}
},