setColumnHidden doesn't work when using callback function

Hi everybody,

I currently use a dhtmlxAjax.get(url, myfunction) to update some data on my database.
Once the datas are updated, the callback function is used to reload an existing grid which has a hidden column.

However, after reloading the grid, the hidden column becomes visible…
Here is a sample of my js code :

// The Grid :

        dhtmlx.image_path='./codebase/imgs/';

	var myLayout = new dhtmlXLayoutObject(document.body, '1C');

	var content = myLayout.cells('a');
	var myGrid = content.attachGrid();
	myGrid.setIconsPath('./codebase/imgs/');
	myGrid.setColumnHidden(2, true); // Column 3 is hidden
	
	myGrid.setHeader(["Column 1","Column 2","Column 3","Column 4"]);
	myGrid.setColTypes("ro,ro,ro,ro");
	
	myGrid.setColSorting('str,str,str,str');
	myGrid.init();
	myGrid.load('./data/grid.xml', 'xml');

// The Request (triggered with an attached Event):

url = 'model/myfile.php?action=uptd&param1=hello&param2=world'; dhtmlxAjax.get(url, reloadMyGrid);

// The callback function

function reloadMyGrid() { myGrid.clearAll(); myGrid.load('./data/grid.xml', 'xml'); }

After reloading, Column3 becomes visible.
I tried with adding myGrid.setColumnHidden(2,true) or myGrid.setColumnsVisibility(‘true, true, false, true’) in the callback function at the end of it. It doesn’t neither…

Can someone help me ?

Thank you !

I currently use dhtmlx Suite Pro 3.0

I just found a workaround…

set the hidden=“true” attribute in my column definition in my xml file.

But it doesn’t explain why the other way does not work. :unamused:

Unfortunately the issue cannot be reconstructed.
Hidden columns stay hidden after reloading of the grid if they were hidden with setColumnHidden()