EasyUI Forum
April 17, 2024, 08:54:11 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: a suggestion about datagrid  (Read 19304 times)
l3917055
Newbie
*
Posts: 11


View Profile Email
« on: February 27, 2013, 12:43:07 AM »

sometimes,I used column's formatter or any other cause sort field and display field is not the same

I mean I need a different field to sort, different from the display field。

I think, easyui can use  the display field to sort when the sortfiled property is not define
          and easyui should  use the sortfiled property  when the sortfiled is defined 
Logged
l3917055
Newbie
*
Posts: 11


View Profile Email
« Reply #1 on: February 27, 2013, 08:43:41 PM »

like this
  columns: [[{ field: 'Name', title: 'Name', width: 80,sortField:'otherFiled' , sortable: true },
                  { field: 'Email', title: 'Email', width: 80, sortable: true }
               ]],
Logged
azizkhani
Newbie
*
Posts: 37


View Profile Email
« Reply #2 on: January 15, 2015, 10:53:22 AM »

like this
  columns: [[{ field: 'Name', title: 'Name', width: 80,sortField:'otherFiled' , sortable: true },
                  { field: 'Email', title: 'Email', width: 80, sortable: true }
               ]],


hi
i have this problem too
how can solve your problem  Huh Huh Huh
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: January 15, 2015, 06:47:04 PM »

Before a request is made to load data from remote server, the 'onBeforeLoad' event fires, in which you can change any request parameters including the sort name.
Code:
$('#dg').datagrid({
onBeforeLoad: function(param){
if (param.sort == 'Name'){
param.sort = 'otherField';
}
}
})
Logged
azizkhani
Newbie
*
Posts: 37


View Profile Email
« Reply #4 on: March 26, 2015, 08:51:49 AM »

Before a request is made to load data from remote server, the 'onBeforeLoad' event fires, in which you can change any request parameters including the sort name.
Code:
$('#dg').datagrid({
onBeforeLoad: function(param){
if (param.sort == 'Name'){
param.sort = 'otherField';
}
}
})


how can override datagrid to add sortname property to field to dose not force to write this bad code for all my grid
plz help me
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!