Hi,
I'm looking for a way to save and restore the width of columns. Some of the users of my software may want to manually size some columns and when they next visit the same page, they expect the columns widths to be the same as they were last time. How would I do this?
BTW, I'm using the ASP.NET MVC wrappers.
Thanks,
Al
Hello alai604,
You can use Ajax post to save the column width as soon as user finishes column resizing. You should bind to igGridResizing's columnResized event.Example code:
//Bind after initialization $(document).delegate(".selector", "iggridresizingcolumnresized", function (evt, ui) { // make your ajax call here // use ui.columnIndex or ui.columnKey to identify the column // use ui.newWidth to get the new width of the column });
//Bind after initialization
$(document).delegate(".selector", "iggridresizingcolumnresized", function (evt, ui) {
// make your ajax call here
// use ui.columnIndex or ui.columnKey to identify the column
// use ui.newWidth to get the new width of the column
});
For performance reasons you should set deferredResizing property to true.
For more information on columnResized event you can check our online API documentation:
http://help.infragistics.com/jQuery/2011.2/ui.iggridresizing#events
If you need information on how to use jQuery Ajax functions:
http://api.jquery.com/jQuery.post/
Hope this helps,
Martin Pavlov
Infragistics, Inc.
Persisting the new column width after every resize could pose some performance overhead, and can eventually become a bottleneck in the application, since there will be an AJAX request for every resize end-user interaction. Of course, there are various alternative methods of doing this.
Angel