Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Vikram Jagannathan on Mar 26, 2009 09:46
open dhtmlx forum
loadSizeFromCookie, after columns are moved, resizes incorrect columns.

Hi,

If the columns are moved, loadSizeFromCookie() resizes incorrect columns.

TestCase: File: pro_column_states_save.html

Steps:
1) Click on "save columns width" button.
2) Move "Sales" column to between "Book Title" and "Author".
3) Increase the size of "Sales" column.
3) Click on "restore columns width" button.

Result:
- Size of "Book Title" column changes to the original size of "Sales" column.
- Size of "Sales" column changes to the original size of "Book Title" column.

Expected Result:
- Only "Sales" column's size should change to its original value. Other column's sizes should remain the same.

Can you please provide a solution/fix? One possible solution is to process saving/loading column size based on the column id rather than the position index.

Thanks.
Answer posted by Support on Mar 27, 2009 03:19
The behavior confirmed, but it not really a bug; with current implementation grid saves sizes for each column based on their indexes, and restore sizes in the same manner
In common use-case restore size functionality used after page reload, so it applied to the grid with original order of columns and above problem is not actual. 

You may add next line of code to workaround issue

grid.attachEvent("onAfterCMove",function(){
      grid.saveSizeToCookie();
})

As result after each column order changing , new set of sizes will be saved. 

>>One possible solution is to process saving/loading column size based on the column id
Yes, it may be a better way, but while column index exists in any case, column ID can be not defined - which will limit usage of "saved-states" functionality for grid with column IDs only. 
Answer posted by Vikram Jagannathan on Mar 27, 2009 13:23
Two more issues:

1) TestCase: File:
pro_column_states_save.htm: mygrid (First Grid)
a) Click on "save order" button.
b) Move "Sales" column to between "Book Title" and "Author".
c) Click on "restore order" button.
Result:
- No change in the column order.
Expected Result:
- "Sales" column should move back to the original First position.
Inference:
- If the "save order" button is clicked before moving a column, the initial order is not saved.

2) TestCase: File: pro_column_states_save.htm: mygrid2 (Second Grid)
a) Move "Sales" column to between "Book Title" and "Author".
b) Increase the size of "Sales" column.
c) Refresh/Reload page
Result:
- Size of "Sales" column changes to its original size.
Expected Result:
- "Sales" column should retain the new increased size.
Inference:
- Once a column is moved, then if a column is resized, the new size is not automatically stored in the cookie.

Please provide a solution/fix.

Thanks.
Answer posted by Vikram Jagannathan on Apr 06, 2009 08:44

Hi Support,

Any updates on the two aforementioned issues?

Thanks.

Answer posted by dhxSupport on Apr 07, 2009 03:56
This bug confirmed. We will contact you when it will be fixed.
Answer posted by dhxSupport on Apr 07, 2009 05:29
This bug was fixed. Fix will be send you by email.