|
Title: datagrid 'sort' method without 'load' Post by: phunksta on March 19, 2015, 06:59:07 AM Hi,
I have been looking at the 'sort' method of the datagrid. For performance, I re-use some datagrids in my application. I have to 'reset' them before re-use, and loading new data. To do this I first remove filters as I am using this extension. The method 'removeFilterRule' does this, and will not reload the data. I also need to reset any user sort actions. My problem is that I have 'remoteFilter=true'. When I call the sort method, the datagrid is loaded after the new sort is applied. What I really need is a 'resetSort' method, or a 'sortNoLoad' method. I understand I could copy the whole method and extend the object defaults, and then omit the 'load' part of the code, but am I missing an easier way to the same functionality? Thanks Title: Re: datagrid 'sort' method without 'load' Post by: stworthy on March 19, 2015, 07:38:06 PM To prevent from loading data from remote server, just return false in 'onBeforeLoad' event. If you only want to reset the sorting flag on the column header, the 'resetSort' method can be extended as below:
Code: $.extend($.fn.datagrid.methods, {Usage example: Code: $('#dg').datagrid('resetSort'); // clear all the sorting flagTitle: Re: datagrid 'sort' method without 'load' Post by: phunksta on March 26, 2015, 07:52:18 AM Great Thanks!
|