Enabling auto saving for column size, position, ordering,and

and column hiding…

Hi folks,

Question about saving the states of these to cookies. I appear to have the column positions saved to cookies working but column sizes, ordering (sort order), and column hiding don’t seem to save their state. I’ve tried initializing my grid with grid.enableAutoSaving(); and on startup I do (using default cookie name):


grid.loadOrderFromCookie();
grid.loadSizeFromCookie();
grid.loadSortingFromCookie();

I also tried initializing with:

grid.enableAutoSizeSaving();
grid.enableSortingSaving();
grid.enableOrderSaving();
grid.enableAutoHiddenColumnsSaving();

But have the same results in that the column positions (order) work but the other states don’t restore on startup.

Any ideas? Do I manually need to attach events? I assumed not since I’m using defaults and since column positions are saved.

Thanks for any suggestions,
Kurt

Also I am using the DHTMLXSuite Pro Commercial version.

Thanks.

I’d like to update status here and elaborate…size, ordering, and hidden columns seem to save and all work fine. However when I set column re-ordering enabled everything goes haywire. Do I need to customize the default saving of the others? If the defaults are using indexes rather than column names things won’t work. I have column names and any code accessing a column uses their name but not sure what the default loadXYZFromCookie() does.

Thanks for any help,
Kurt

ugh re-ordering I mean column moving.

When restoring elements be sure to

a) call it after grid.init() but before data loading
b) restore column order at first other after that
c) saving must be enabled only after loading

[code]grid.loadOrderFromCookie();
grid.loadSizeFromCookie();
grid.loadSortingFromCookie();
grid.loadHiddenColumnsFromCookie();

grid.enableAutoSizeSaving();
grid.enableSortingSaving();
grid.enableOrderSaving();
grid.enableAutoHiddenColumnsSaving();
[/code]

Thank you! I saw that in an example but maybe it should be more clear or obvious in the API docs? Or did I miss it?

Thanks, all is working now.

We will extend documentation, because existing description is not so clear for sure.