{ field: 'goods_status', title: '货物状态', align:'center',width:"80px",sortable:false,editor:'text',
formatter:function(value,row){
return row.goods_status;
},
editor:{
type:'combobox',
options:{
valueField:'goods_status_desc',
textField:'goods_status_desc',
url:'goodsStatus.do',
onSelect: function (data) {
//选中后执行要执行的动作 $('#grid').datagrid('getEditor',{index:editIndex,field:'goods_status_id'}).target.val(data.goods_status_id);
} ,
onLoadSuccess: function () {
//加载完成,默认选中
var data = $(this).combobox('getData');
$(this).combobox('select',data[0].goods_status_desc);
$('#grid').datagrid('getEditor',{index:editIndex,field:'goods_status_id'}).target.val(data[0].goods_status_id);
// $(this).combobox('setValue', data);
// $(this).combobox('setText', '--请选择--');
},
required:true,
panelHeight:"auto",
editable:false
}
}
},
参考:https://ask.csdn.net/questions/204675 结合自己的需求修改的