JqGrid Select Box in a cell

好久不见. 提交于 2019-12-24 00:44:41

问题


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
     }); 

回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/4739715/jqgrid-select-box-in-a-cell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!