EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
April 19, 2024, 12:59:13 AM
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
>
EasyUI for jQuery
>
Custom sort code
Pages: [
1
]
« previous
next »
Print
Author
Topic: Custom sort code (Read 9946 times)
joker
Newbie
Posts: 17
Custom sort code
«
on:
August 05, 2013, 03:04:38 AM »
Hi,
When I Click column header with sortable feature , I hope it can execute my own code ,but not sort automatically,how can I do it.
Thanks!
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: Custom sort code
«
Reply #1 on:
August 05, 2013, 06:09:43 AM »
Use sorter function to define your custom sorting.
Code:
$('#dg').datagrid({
columns:[[
{field:'name',sorter:function(a,b){
//...
}}
]]
});
Logged
joker
Newbie
Posts: 17
Re: Custom sort code
«
Reply #2 on:
August 05, 2013, 06:55:39 PM »
Maybe I don't describe my problem clearly.I want to implement Multiple Sorting,so when I click column header, I hope it don't sort automatically,I hope I can get column name and push it into array,then I can handle it in server side.But i don't know how to deal with it.I try to execute my code in onSortColumn event,but it can't stop datagrid sort automatically first,So what shall i do?
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: Custom sort code
«
Reply #3 on:
August 06, 2013, 04:44:50 PM »
The multiple sorting is the build-in feature since version 1.3.4. If you are using version 1.3.3, download the datagrid plugin from
http://www.jeasyui.com/easyui/plugins/jquery.datagrid.js
and include it in your page.
Logged
joker
Newbie
Posts: 17
Re: Custom sort code
«
Reply #4 on:
August 06, 2013, 06:57:20 PM »
Thanks for your reply。
But I still have a problem,How can I switch Multiple Sorting and Single Sorting in datagrid?
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: Custom sort code
«
Reply #5 on:
August 06, 2013, 08:25:38 PM »
Here is the multiple sorting example.
http://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=Multiple%20Sorting
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...