EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
April 17, 2024, 08:54:11 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
General Discussion
>
a suggestion about datagrid
Pages: [
1
]
« previous
next »
Print
Author
Topic: a suggestion about datagrid (Read 19304 times)
l3917055
Newbie
Posts: 11
a suggestion about datagrid
«
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
Re: a suggestion about datagrid
«
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
Re: a suggestion about datagrid
«
Reply #2 on:
January 15, 2015, 10:53:22 AM »
Quote from: l3917055 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 }
]],
hi
i have this problem too
how can solve your problem
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: a suggestion about datagrid
«
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
Re: a suggestion about datagrid
«
Reply #4 on:
March 26, 2015, 08:51:49 AM »
Quote from: stworthy 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';
}
}
})
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
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...