2011-01-19 138 views
2

我想让选择框在特定的单元格中。我有复选框显示正常,但选择框没有显示。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 
    }); 

回答

2

可能是误解。只有当单元格处于编辑模式时,才会在单元格中看到选择框。例如,您可以在您当地的jqGrid cell editing支持,如果您在网格定义

cellEdit: true, 
cellsubmit: 'clientArray' 

两个额外的参数也可以使用inline editing代替。

我不确定mydata数组的样子是怎么样的。可能需要添加formatter:'select',除了'ship'列的定义之外。

+0

谢谢,我一直面临着同样的问题 – Xravn 2015-09-18 06:14:51

0

感谢我得到它的工作是与不具有cellEdit,cellsubmit:和editurl一个问题:添加到网格