Slickgrid With CheckboxSelectColumn: Hide Checkbox in Some Rows

1,838 views
Skip to first unread message

Jonnas Carvalho

unread,
Apr 7, 2014, 3:16:43 PM4/7/14
to slic...@googlegroups.com
I have a grid with the plugin Slick.CheckboxSelectColumn.

Is it possible, without Jquery, to hide checkboxes in some rows? I guess it's possible using Formatter.

Here is the var with the slickgrid checkbox plugin:

var checkboxSelector = new Slick.CheckboxSelectColumn({             
         cssClass: "slick-cell-checkboxsel"
     });


Columns definition:

var columns = [
        { id: "Id", name: "Id", field: "Id", sortable: true, width: 40 },            
        { id: "Status", name: 'Status', field: "Status", sortable: true, width: 80 },
        checkboxSelector.getColumnDefinition()
     ];


Code to create grid and register plugins:

grid = new Slick.Grid("#grid", dataView, columns, options);
     grid.registerPlugin(new Slick.AutoTooltips({ enableForHeaderCells: true }));
     grid.registerPlugin(checkboxSelector)

James Silberbauer

unread,
Apr 7, 2014, 3:50:58 PM4/7/14
to slic...@googlegroups.com
Take a look at the version of checkboxselectcolumn.js at https://gist.github.com/jcsjcs/10038299

I think this does what you are looking for.

On any row that you do not want to be selected, set the column "not_multiselectable" to "Y".

This is not the most elegant code nor very efficient, but should serve your purpose (or be something you can adapt).

James
--
You received this message because you are subscribed to the Google Groups "SlickGrid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slickgrid+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonnas Carvalho

unread,
Apr 11, 2014, 10:46:58 AM4/11/14
to slic...@googlegroups.com
Thanks.
Reply all
Reply to author
Forward
0 new messages