EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: gordis gmbh on April 22, 2016, 03:05:50 AM



Title: datagrid remote sort: change sort request param value
Post by: gordis gmbh 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.


Title: Re: datagrid remote sort: change sort request param value
Post by: jarry 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';
  }
}


Title: Re: datagrid remote sort: change sort request param value
Post by: gordis gmbh on April 25, 2016, 01:13:18 AM
Thanks for the support. It helped solve the sorting issue!