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

标签 jquery drop-down-menu jqgrid grid

我正在尝试将选择框放在特定的单元格中。我的复选框显示得很好,但选择框没有显示。

 $('#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 - JqG​​rid 单元格中的选择框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4739715/

相关文章:

html - 有没有办法创建具有默认值但没有下拉列表的选择列表

javascript - JQGrid:排序和自定义格式化程序

jquery - jqgrid中有没有一个API可以添加高级过滤器来发布数据?

jquery - 如何添加图像

javascript - 触发点击事件不工作jquery

jquery - jScrollPane Tabs - 如何使它们淡入/淡出?

javascript - 如何根据ID将json中的值数组分配给特定表

jquery - 根据选择隐藏或显示 DIV 的条件 JQuery 表单?

html - 我正在制作下拉菜单,但它垂直显示不正确

php - 是否有用于 JQUERY 网格控件(JQGRID 或数据表)的免费 PHP 包装器或后端脚本