我正在使用 inlineNav (由于这里的帮助而成功!)。
现在dataUrl
在 select 语句中使用,我不明白这种行为。
加载网格时不加载选择选项。在按下编辑或添加记录之前,不会发出选择 HTML 请求。
我可以在加载网格后立即加载它吗?
$("#navgrid").jqGrid({
sortable: true,
rownumbers: true,
url: 'cms.dbw?action=ajaxgrid&sessionid=3d70a780-d6ec-102f-bd56-0015171f0bcc&subaction=jq&tableid=carepln',
editurl: 'cms.dbw',
datatype: 'json',
mtype: 'GET',
pager: '#navgrid_bottompager',
rowNum: 10,
rowList: [10,50,100],
width: 750,
height: '100%',
shrinkToFit: false,
toolbar: [false,'top'],
sortname: 'id',
sortorder: 'asc',
viewrecords: true,
gridview: true,
altRows: false,
toppager: true,
caption: 'Care Plan Detail',
colNames: ['ID','Act','Resident Code','Care Code'],
colModel: [
{name:'id',index:'id',width:50,align:'center',search:false,key:true,hidden:true},
{name:'active',width:30,align:'center',editable:true,edittype:'checkbox',editoptions: {value:'Y:N'},formatoptions:{disabled:false,value:"Y:N"}},
{name:'resid',align:'left',editable:true,width:70},
{name:'classid',align:'left',editable:true,edittype: 'select',editoptions: { dataUrl: 'cms.dbw?action=ajaxgrid&sessionid=3d70a780-d6ec-102f-bd56-0015171f0bcc&subaction=jqsubtable&tableid=careserv&field1=classid&field2=description'} ,width:70}
]
});
{"page":1,"records":4024,"total":403,"rows":[{"id":"1","cell":["1","Y","100243", "22020"]},{"id":"2","cell":["2","Y","100220","22020"]},{"id":"3","cell" :["3","Y","100193","22020"]},{"id":"4","cell":["4","Y","100082","22020"] },{"id":"5","cell":["5","Y","100068","22020"]},{"id":"6","cell":["6 ","Y","100241","22020"]},{"id":"7","cell":["7","Y","100215","22020"]},{"id":"8","cell":["8","Y","100059","22020"]},{"id":"9", "细胞":["9","Y","100240","22020"]},{"id":"10","细胞":["10","Y","100009"," 22020"]}]}
在dataUrl
开始编辑之前不会解决。并且编辑后不显示。