Show column / hide column

Hello

Example:
In my Grid are 8 columns (3 are hidden with ‘setColumnHidden’). The user got the option to reload page and show all 8 columns.
I tried

Grid[2].clearAll();
Grid[2].loadXML("../dhtmlx/Data/XML/grid.php?id=45&j=<?php echo $_GET['j']; ?>&s1="+ToolBar[2].getItemState("orders")+"&s2="+ToolBar[2].getItemState("termin"));

but this just reloads the Grid and the 3 hidden columns are not shown. I need an option to reload the “whole” Grid … not just the rows in the existing Grid.

Thank you

Best regards
Oliver

Really no idea ?

please, try to use:
grid.clearAll(true) // it clears the data and the header of the grid.


If i write the following and try to reload grid kills the header, the grid and loads and loads and loads …

Grid[2].clearAll(true);
Grid[2].loadXML("../dhtmlx/Data/XML/grid.php?id=45&j=<?php echo $_GET['j']; ?>&s1="+ToolBar[2].getItemState("orders")+"&s2="+ToolBar[2].getItemState("termin"));


Is your header structure is included in the xml?
If you are clearing the header, you need to create it again before loading the data.

First … happy new year :slight_smile:

Now a stupid question … how can i include header information in my xml :blush: ?

Happy New Year! :smiley:

Forget it. Please, try to use the following code:

Grid[2].clearAll(); for(var i=0; i<Grid[2].getColumnsNum(); i++){ Grid[2].setColumnHidden(i,false) } Grid[2].loadXML("../dhtmlx/Data/XML/grid.php?id=45&j=<?php echo $_GET['j']; ?>&s1="+ToolBar[2].getItemState("orders")+"&s2="+ToolBar[2].getItemState("termin"));

That helped :wink:

Thank you