views:

267

answers:

2

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")

+1  A: 

This should probably work:

.slick-header-columns { display: none; }
Deniz Dogan
I tried this. It doesn't work. The rest of the cells disappear as well.
Misha Moroshko
@Misha Moroshko: When I tried it using Firebug on the example page it worked just fine. I can't see anything in the HTML that would make the other cells disappear.
Deniz Dogan
Could you please tell me where did you add this code using Firebug ?
Misha Moroshko
I selected the `div` with class `slick-header-columns` and chose "Add property" to the class CSS rule.
Deniz Dogan
It's strange. It really works with Firebug, but if I download the SlickGrid package and change this example as you proposed it does not work....
Misha Moroshko
This won't work. See my answer for a workaround.
Tin
+1  A: 

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.

Tin
Thanks ! The workaround works :) It would be nice to have this basic(?) feature in the future. Thank you for your time !
Misha Moroshko
@moroshko: You can always add it to Issues on GitHub as a feature request ;)
Tin