0

我搜索了所有可用的资源,但无济于事。我试图使一列可编辑(参见下面的第 7 列),但到目前为止没有任何效果。我已经将可编辑属性设置为 true。我的猜测是它与网格属性集有关,但我无法弄清楚我需要编辑哪个属性,以便我的可编辑列可以工作。

$('#pGrdList0').jqGrid({
    "url" : "clientArray",
    "editurl" : "server.php",
    "datatype" : "local",
    "width" : "900",
    "height" : "338",
    "rowNum" : "1000",
    "colNames" : 
        [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" ],
    "colModel" :
        [ {"name" : "g1", "index" : "g1", "width" : "115", "align" : "left", "edittype" : null, "formatter" : null, "formatoptions" : null, "editoptions" : null, "editable" : false},
          {"name" : "g2", "index" : "g2", "width" : "15", "align" : "right", "edittype" : null, "formatter" : null, "formatoptions" : null, "editoptions" : null, "editable" : false},
          {"name" : "g3", "index" : "g3", "width" : "68", "align" : "right", "edittype" : null, "formatter" : null, "formatoptions" : null, "editoptions" : null, "editable" : false},
          {"name" : "g4", "index" : "g4", "width" : "68", "align" : "right", "edittype" : null, "formatter" : null, "formatoptions" : null, "editoptions" : null, "editable" : false},
          {"name" : "g5", "index" : "g5", "width" : "68", "align" : "right", "edittype" : null, "formatter" : null, "formatoptions" : null, "editoptions" : null, "editable" : false},
          {"name" : "g6", "index" : "g6", "width" : "68", "align" : "right", "edittype" : null, "formatter" : null, "formatoptions" : null, "editoptions" : null, "editable" : false},
          {"name" : "g7", "index" : "g7", "width" : "68", "align" : "right", "formatter" : numberFormatter, "formatoptions" : {thousandsSeparator:',',decimalPlaces:0,defaultValue:''}, "editoptions" : "{maxlength: 9, dataInit:setImeDisabled}", "editable" : true},
          {"name" : "g8", "index" : "g8", "width" : "68", "align" : "right", "edittype" : null, "formatter" : null, "formatoptions" : null, "editoptions" : null, "editable" : false},
          {"name" : "g9", "index" : "g9", "width" : "80", "align" : "right", "edittype" : null, "formatter" : null, "formatoptions" : null, "editoptions" : null, "editable" : false},
          {"name" : "g10", "index" : "g10", "width" : "215", "align" : "left", "edittype" : "text", "formatter" : null, "formatoptions" : null, "editoptions" : {maxLength:30, dataInit:setImeEnabled}, "editable" : true} ],
    "pager" : "#pGrdList0nav",
    "viewrecords" : false,
    "cellEdit" : true,
    "cellsubmit" : "clientArray",
    "multiselect" : false,
    "forceFit" : false,
    "shrinkToFit" : false,
    "pgbuttons" : false,
    "pginput" : false,
    "pgtext" : false,
    "onCellSelect": function(rowid, iCol, cellcontent, e) {
        var grid = $('#pGrdShinkoujoukenichiran0');
        grid.setSelection(rowid, true);
    }
});
4

2 回答 2

3

好吧,我发现您的代码没有任何问题,我没有对其进行测试,但我认为您应该这样编写

可编辑:真....不带双引号

于 2012-07-24T11:31:39.247 回答
0

我也遇到过类似的事情……请记住,jqgrid 是模块化的,因此您必须请求将编辑选项包含在您的副本中。

所以当你下载 jqgrid 时,一定要检查所有的编辑选项。

于 2012-12-05T19:11:53.017 回答