Hiding columns with cookies enabled

I have following order in my implementation:


Automatic saving to cookie. The order of calling the related methods
mygrid = new dhtmlXGridObject(‘gridbox’);

mygrid.init(); // firstly, initialize the grid
mygrid.enableHeaderMenu();
mygrid.loadOrderFromCookie(); // then restore the required data
mygrid.loadSizeFromCookie();
mygrid.loadHiddenColumnsFromCookie();

mygrid.enableAutoSizeSaving(); // enable saving cookies
mygrid.enableOrderSaving();
mygrid.enableAutoHiddenColumnsSaving();

mygrid.load(“mygrid.json”, “json”); // load data to the grid



I wanted to add following lines to the above code:

mygrid.setColumnHidden(0,true);// Hide 0th column by default
mygrid.setColumnHidden(7,true);// Hide 7th column by default

Where should I add the setColumnHidden lines so that they do not interfere with each other and load correctly?

Is there any compatibility issue?

If you need that the 0 and 7 columns to be hidden after the page is loaded try to place setColumnHidden() methods after the cookies parameters are loaded.
mygrid.loadHiddenColumnsFromCookie();

mygrid.setColumnHidden(0,true);// Hide 0th column by default
mygrid.setColumnHidden(7,true);// Hide 7th column by default

Thanks for the reply. However, myGrid.setColumnHidden is not working with grouped rows. It doesn’t matter where I place these lines of code.

The line showing count of rows comes up as blank.




My bad… It works…

I was hiding the first column after grouping. This is already a known issue.