/*
* dg 當前datagrid的ID
* idx 當前行的索引值 ``
* Field 需要獲取的編輯器顯示的字段
*/
function getEditor(dgId,idx,Field){
return dgId.datagrid('getEditor', {index : idx,field : Field});
}
獲取當前索引值
dg.datagrid('getRowIndex',row)
獲取編輯器後賦值
//調用方法
//combobox是編輯器的type,在getEditor返回值得到的object中有這個屬性
var textArr = [{id : 1, mc : 'vue'},{id : 2, mc : 'react'}];
getEditor(dgId,1,'Field').target.combobox({
data : [{},{}], //數據最好是個數組,每一項是一個對象
valueField: 'mc', //將會顯示的內容
textField: 'id', //下拉之後看到的內容
})