JqG​​rid 单元格中的选择框

发布于 2024-10-13 07:32:07 字数 1706 浏览 6 评论 0原文

我试图让选择框位于特定的单元格中。我的复选框显示得很好,但选择框没有显示。

 $('#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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三生一梦 2024-10-20 07:32:07

大概是误会吧。仅当单元格处于编辑模式时,您才会在单元格中看到选择框。例如,您可以在本地 jqGrid 中包含 单元格编辑 支持,如果您在网格定义中包含两个附加参数

cellEdit: true,
cellsubmit: 'clientArray'

您还可以使用内联编辑 相反。

我不确定 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

cellEdit: true,
cellsubmit: 'clientArray'

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.

秋意浓 2024-10-20 07:32:07

谢谢,我让它工作了,这是一个没有将 cellEdit、cellsubmit: 和 editurl: 添加到网格的问题

Thanks I got it working it was an issue with not having cellEdit, cellsubmit:, and editurl: added to the grid

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文