Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the header in SlickGrid?

I know that there is no API to remove the header row, but I'm sure it can be done by modifying some CSS. Any ideas ?

For example, here: http://mleibman.github.com/SlickGrid/examples/example4-model.html

CSS experts ! I need your help with this one. I'm interested in changing the CSS code of the package that removes the header row. CSS code that can be loaded on top of the package is preferred. The source code is here: http://github.com/mleibman/SlickGrid (Press "Download Source")

like image 944
Misha Moroshko Avatar asked Oct 17 '25 10:10

Misha Moroshko


2 Answers

The short answer is that doing this is not supported in SlickGrid, at least at the moment. The CSS workaround doesn't work because SlickGrid uses the DOM elements in the header to calculate the dimensions of the viewport. Setting it to display:none makes SlickGrid think that the grid is 0 pixels wide.

You can sort of get around it by doing $(".slick-header-columns").css("height","0px") followed by a call to grid.resizeCanvas() to get rid of the remaining whitespace at the bottom of the grid.

like image 159
Tin Avatar answered Oct 19 '25 23:10

Tin


Just add the following to the grid options:

headerHeight: 0

and then in your css put something like:

#myGridID .slick-header-columns {
  display: none;
}
like image 40
eugenevb Avatar answered Oct 20 '25 01:10

eugenevb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!