1

如何在 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);
4

1 回答 1

3

尝试如下,

var checkboxSelector = new Slick.CheckboxSelectColumn({
        cssClass: "slick-cell-checkboxsel"
    });
columns.push(checkboxSelector.getColumnDefinition());    
grid.registerPlugin(checkboxSelector);
于 2013-07-19T06:59:16.783 回答