我正在尝试将选择框放在特定的单元格中。我的复选框显示得很好,但选择框没有显示。
$('#list5').jqGrid({ datatype: "local", width: "100%", height: "100%", colNames:['Universe1','Connect String1', 'Report1', 'Object Type1','Path1','Owner1', '|', 'Universe', 'Select','Connect String', 'CheckBox', 'Report', 'Object Type','Path','Owner'], colModel:[ {name:'universe1', index:'universe1', width:70},{name:'connect1',index:'connect1', width:120}, {name:'report1',index:'report1', width:90}, {name:'objType1',index:'objType1', width:50, align:"right"}, {name:'path1',index:'path1', width:50, align:"right"}, {name:'owner1',index:'owner1', width:100, align:"right"}, {name:'pipe',index:'pipe', width:10, align:"center"}, {name:'universe', index:'universe', width:70}, {name:'ship',index:'ship', width:90, editable: true, edittype:"select", formatoptions: {disabled : false}, editoptions:{value:"FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX"}}, {name:'connect',index:'connect', width:120}, { name: 'airPost', width: 40, index: 'airPost', formatter: 'checkbox', align: 'center', //Checkbox editoptions: { value: "1:0" }, stype: 'select', editable:true, searchoptions: { value: "1:Yes;0:No" }, formatoptions: {disabled : false} }, {name:'report',index:'report', width:90}, {name:'objType',index:'objType', width:50, align:"right"}, {name:'path',index:'path', width:50, align:"right"}, {name:'owner',index:'owner', width:100, align:"right"} ], caption: "Grid", autowidth: true, viewrecords: true, footerrow: true, userDataOnFooter: true, data: mydata });
最佳答案
可能是误会。仅当单元格处于编辑模式时,您才会在单元格中看到选择框。例如,您可以包括 cell editing如果您在网格定义中包含两个附加参数,则本地 jqGrid 中的支持
cellEdit: true,
cellsubmit: 'clientArray'
您还可以使用inline editing相反。
我不确定 mydata
数组中的数据是什么样的。可能需要,您必须添加 formatter:'select'除了“ship”列的定义之外。
关于jquery - JqGrid 单元格中的选择框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4739715/