JqGrid 单元格中的选择框
我试图让选择框位于特定的单元格中。我的复选框显示得很好,但选择框没有显示。
$('#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 });
I am trying to get a select box to be in a particular cell. I have the checkboxes showing up just fine, but the select boxes are not being displayed.
$('#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 });
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
大概是误会吧。仅当单元格处于编辑模式时,您才会在单元格中看到选择框。例如,您可以在本地 jqGrid 中包含 单元格编辑 支持,如果您在网格定义中包含两个附加参数
您还可以使用内联编辑 相反。
我不确定
mydata
数组中的数据是什么样的。可能需要,您必须添加 formatter:'select' 除了“ship”列的定义之外。Probably it is misunderstanding. You will see select box in cell only if the cell will be editing mode. For example you can include cell editing support in your local jqGrid if you include two additional parameters in the grid definition
You can also use inline editing instead.
I am not sure how your data in
mydata
array look like. It can be needed, that you have to add formatter:'select' additionally to the definition of the 'ship' column.谢谢,我让它工作了,这是一个没有将 cellEdit、cellsubmit: 和 editurl: 添加到网格的问题
Thanks I got it working it was an issue with not having cellEdit, cellsubmit:, and editurl: added to the grid