How to retrive column order and size
I have a grid can do column resizing and reordering by drag and drop. I want to put a button on my page so that I can post the size and order for each column back to server when user clicks the button. I have following questions.
1) How do I retrive the size each column?
I am trying to use following code to retrive the size for each column and I am not sure if this is correct.
2) How to get and set the column orders?
I tried to use
3) How can I intercept the resize event so I can add my code to save the size of each column.
1) How do I retrive the size each column?
I am trying to use following code to retrive the size for each column and I am not sure if this is correct.
var i, widths = [], count = myGrid.getColumnProperty("count");
for (i=0; i<count;i++){
widths[i] = myGrid.getTemplate("top/item", i).element().offsetWidth;
}
2) How to get and set the column orders?
I tried to use
myGrid.setColumnProperty("values",[0,2,1,4,3])
to set the order of the columns and it doesn't work. Is there a way to reorder to grid without phyiscally change the data? Can I use myGrid.getColumnProperty("values") to retrive to the order?
3) How can I intercept the resize event so I can add my code to save the size of each column.
Hao
July 5,