Moved columns not saving the correct size


When I attempt to use the enableAutoSizeSaving() and enableOrderSaving() methods - the behaviour I se is not as expected.

This is my grid set-up:

    var grid;

    function doInitGrid()


        grid = new dhtmlXGridObject(‘gridbox’);


        grid.setHeader(“Column 0, Column 1, Column 2, Column 3, Column 4, Column 5, Column 6”);



















    function restore()




Expected behaviour:

When column 2 is moved over column 3 and then the page reloaded, the columns should retain their initial widths. (20% at index 3 and 10% at index 2)

Actual behaviour:

After the page reload the columns have swapped their widths, column 2 (now index 3) is 10% width and column 3 (now index 2) is 20%.

When the page is reloaded AGAIN, the colums swap widths again; the columns continue to swap widths on every subsequent reload.

Moving column 2 further up the grid, to index 5 or 6 for e.g. causes many columns to swap widths and for every reload each column will have a different width.

Is this an error in my grid set up or a bug?

Thanks for any help, Luke.

The operations with grid rows can be executed only after data is loaded:


function doAfterXMLLoading(){

Please, take a look at the sample in the grid package:


Hi, thanks for the reply.

However even using the supplied code the same problem is occuring.

If I remove the loadSizeFromCookie() call from the code, the problem doesn’t occur - the columns have their correct size after a reload.

Also if I call loadOrderFromCookie() before loadSizeFromCookie(), again the problem does not occur and the columns have their correct size.

But in either of these cases any other column resizing is not saved.


Thanks again, Luke.


Sorry for inconvenience, the previous example was not fully correct, the correct order of commands


because all other settings are column depending, order need to be restored first and only after that all other settings of the column.