Hide checkbox only from slickgrid title bar

enter image description here

Code1:

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

Codex2:

  tempGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false})); tempGrid.registerPlugin(checkboxSelector); 

I am using the code above to show the checkbox column.

How to hide checkbox only from slickgrid title bar? (under the red circle in the image)

Thanks.

+4
source share
3 answers
 grid.onHeaderRowCellRendered.subscribe(function (e, args) { if (args.column.id === '_checkbox_selector') { // do something if you want } else { $(args.node).empty(); $('<input type="text">') .data('columnId', args.column.id) .val(columnFilters[args.column.id]) .appendTo(args.node); } }); 
+8
source

I was able to do this, but my solution was to comment out a few lines in the slick.checkboxselectcolumn.js file. From what I can tell, handleSelectedRowsChanged() really overwrites the contents of the flag cell header with a new <input> element every time it changes - it doesn't just change the checked attribute. Therefore, I commented on the lines in this function that make the exchange, as well as several others that add a flag to init, and the - (de) event selects everything.

https://gist.github.com/1085623

Probably the best way to get close to this, but I needed something to get out the door as soon as possible.

+3
source

You can use jQuery to remove this check box.

 $('.slick-header-columns input[type="checkbox"]').remove(); 

However, this check box in the title bar allows you to run Check All. Are you sure you want to delete it?

+1
source

All Articles