EasyUI Forum
May 15, 2024, 05:51:02 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: datagrid remote sort: change sort request param value  (Read 5765 times)
gordis gmbh
Full Member
***
Posts: 103


View Profile Email
« on: April 22, 2016, 03:05:50 AM »

I am using remote sort in a datagrid. On sorting a column, the fieldname is sent as value for the request parameter 'sort'.

Is there a possiblitly to change the value for sort parameter before sending the request? For e.g. in onBeforeColumnSort event?

The following didn't work:
Code:
		onBeforeSortColumn: function(sort, order) {
if(sort == 'solutionComponentName') {
$(this).datagrid('options').sortName = 'solutionComponent';
}
}
The request on the remote server is still made as sort=solutionComponentName.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 on: April 22, 2016, 08:36:12 PM »

You can change the sort parameter value in the 'onBeforeLoad' event.
Code:
onBeforeLoad: function(param){
  if (param.sort == 'solutionComponentName'){
    param.sort = 'solutionComponent';
  }
}
Logged
gordis gmbh
Full Member
***
Posts: 103


View Profile Email
« Reply #2 on: April 25, 2016, 01:13:18 AM »

Thanks for the support. It helped solve the sorting issue!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!