【问题标题】:custom column checkbox formatter using jquery使用 jquery 的自定义列复选框格式化程序
【发布时间】:2017-03-15 04:33:17
【问题描述】:

我必须在其中一列(中间列)中添加复选框..我应该制作一些行不可编辑的复选框..我只需要知道如何为标题实现全选选项..它不是出现在网格中.. 我已经设置了 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'
                    });
                }

请帮忙!!提前致谢 。我必须使 Visibility 列具有复选框 .. 它适用于该列,但在标题中我必须添加 .. enter image description here

【问题讨论】:

    标签: javascript jquery checkbox datagridviewcheckboxcell checkboxpreference


    【解决方案1】:

    找到

                          "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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-24
      • 1970-01-01
      • 1970-01-01
      • 2017-02-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多