EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: mridul on March 03, 2015, 04:11:44 AM



Title: Navigating to first page when user click a column header for sorting
Post by: mridul on March 03, 2015, 04:11:44 AM
Hi,

I am using datagrid with server-side pagination. When user navigate to a certain page "n" and clicks on an column to sort, the sorted result is displayed but the page is "n".

Is it possible  show the sorted result with page 1.



Title: Re: Navigating to first page when user click a column header for sorting
Post by: stworthy on March 03, 2015, 09:04:30 AM
Please try this:
Code:
$('#dg').datagrid({
onBeforeSortColumn:function(){
$(this).datagrid('options').pageNumber = 1;
$(this).datagrid('getPager').pagination('refresh', {pageNumber:1});
}
})