使用 jquery 的自定义列复选框格式化程序

custom column checkbox formatter using jquery

我必须在其中一列(中间列)中添加复选框..我应该让一些行不可编辑复选框..我需要知道的是如何实现 select 的所有选项header .. 它没有出现在网格中 .. 我已经设置了 multiselect:true

columnDisplay = [{"name":"columnId",
                    "label":"Column Id",
                    "type":"string" ,
                     hidden:true,
                     "width":"200",
                     key:true
                  },
                  {
                   "name":"columnDisplayName",
                   "label":"Column Display Name",
                   "type":"string" ,
                   "visibility":true, 
                   "width":"200"
                   },

                   {
                   "name":"visibility", 
                   "label":"Visibility",
                   "editable": true, 
                   "width":"200",
                   "edittype": "checkbox",
                   "editoptions": { value:"Y:N" }, 
                   "formatter": "checkbox", 
                   "formatoptions": { disabled: false}
        }];


createjqGrid : function (gridId , column , gridData){
                $("#" + gridId).jqGrid({
                        datatype: 'local',
                        data: gridData,
                        editurl: 'clientArray',
                        colModel: columns,
                        loadonce: false,
                        autowidth: true,
                        shrinkToFit: false,
                        rownumbers: true,
                        multiselect: multiSelect,
                        multiboxonly:true,
                        cellEdit: false,
                        toppager: true,
                        cloneToTop: true,
                        gridview:true,
                        rowNum: 100,
                        viewrecords : true,
                        pager: "#pager" + gridId,
                        viewsortcols: viewSort,
                        cellsubmit: 'clientArray'
                    });
                }

请帮忙!!提前致谢 。可见性列我必须让它有复选框..它为列工作但在 header 我必须添加.. enter image description here

找到

                      "name":"visibility", 
                       "label":"<input role='checkbox' type='checkbox' id='grid'>Visibility",
                       "editable": true, 
                       "width":"200",
                       "edittype": "checkbox",
                       "editoptions": { value:"Y:N" }, 
                       "formatter": "checkbox", 
                       "formatoptions": { disabled: false}

我们需要设置 role 并且 type 是 checkbox ..所以 header 将得到 checkbox