Slickgrid选择标题列中的复选框

时间:2013-04-10 13:00:58

标签: jquery header checkbox slickgrid

如何在slickgrid中选择标题复选框?在我的slickgrid中,我只能选择所有列,我无法选择列标题中的复选框。

var variablesRows = [];
    var columns = [];
    columns.push(checkboxSelector.getColumnDefinition());
    columns[1] = { id: "description", name: "Description", field: "description",
    sortable: true, width: 311 };

    // Define table options
    var options = {
        enableCellNavigation: true,
        enableColumnReorder: true,
        explicitInitialization: true,
        multiColumnSort: true,
        forceFitColumns: true
    };

    // Create rows
    for (var i = 0; i < variableTypes.length; i++) {
        variablesRows[i] = {
            description: variableTypes[i].Description,
            id: variableTypes[i].VariableId,
            vtype: variableTypes[i].VType,
            valuetype: variableTypes[i].ValueType.replace(/\ /g, '_')
        };
    }

    variablesDataView = new Slick.Data.DataView();

    // Create grid
    variablesGrid = new Slick.Grid("#FDvariableFilterDiv", variablesDataView,
    columns,  options);

1 个答案:

答案 0 :(得分:3)

尝试如下,

var checkboxSelector = new Slick.CheckboxSelectColumn({
        cssClass: "slick-cell-checkboxsel"
    });
columns.push(checkboxSelector.getColumnDefinition());    
grid.registerPlugin(checkboxSelector);