Hi,
I solved the Problem with the cookie, so that the columns order and columns width is restored after restarting the browser.
Now I have got the problem, that I drop the last column at the second position and resize it.
After restarting the browser the order of columns is correct, but the width is not correct.
Here are some line:
var mygrid = new dhtmlXGridObject('div_liste');
mygrid.setImagePath("./imgs/");
datum = new Date();
datum.setDate(datum.getDate()+60);
mygrid.enableAutoSizeSaving('liste','expires='+datum.toGMTString());
mygrid.enableOrderSaving('liste','expires='+datum.toGMTString());
mygrid.init();
mygrid.setSkin("dhx_skyblue");
mygrid.enableMultiselect(false);
mygrid.attachEvent("onRowSelect", rowSelected);
mygrid.attachEvent("onRightClick", function(id,ind,obj){return;});
mygrid.attachEvent("onEditCell", function(stage,rId,cInd,nValue,oValue){return false;});
mygrid.enableColumnMove(true);
function rowSelected(id,ind) {
target = mygrid.getRowAttribute(id,"target");
selectorder(id,target);
}
mygrid.loadXML("./xml.php", function() {
updateInfo();
mygrid.loadSizeFromCookie('liste');
mygrid.loadOrderFromCookie('liste');
});
If you attach events “onResizeEnd”, “onColmnHidden”, “onAfterCMove”, “onAfterSorting” to your Grid, before loading size / hidden columns / order / sorting the function calls loadXyzFromCookie are interpreted as onXyzEvent …
So if I say “loadOrderFromCookie”, it saves “onAfterCMove” the sizes of my current grid to my cookie, and “loadSizeFromCookie” does affect in “nothing” because the data gets overwritten!
So add the named events after loading the data from your cookie, and everything will be fine!
Maybe you can add some changes for that in some future releases, not to call the events on calling the loadXyzFromCookie methods!
Kind regards!
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan