editor:{
type: 'combobox',
options: {
panelHeight: 80,
data:msgBackData,
valueField: 'value',
textField: 'text',
onSelect:function(data){
if(data.value != 0){
var row = datagrid.datagrid('getSelected');
var rowIndex = datagrid.datagrid('getRowIndex',row);//获取行号
var target = datagrid.datagrid('getEditor', {'index':rowIndex,'field':'msgBack'}).target;//这行代码中 field获取的是哪的字段,现在这个代码是不能选中的
target.combobox('clear');
target.combobox("setValue","0");
target.hide();
}
}
}
}
什么叫不能选中,获取不到对应的编辑器对象?
target是dom对象,不是jquery对象,自己要$转为jqeury对象,认真看下api
// get the datebox editor and change its value
var ed = $('#dg').datagrid('getEditor', {index:1,field:'birthday'});
$(ed.target).datebox('setValue', '5/4/2012');