EasyUI Forum
May 05, 2024, 08:34:49 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Geting sorted and order for all the columns  (Read 6626 times)
A-K
Full Member
***
Posts: 122


View Profile WWW
« on: October 31, 2014, 03:13:29 AM »

Hey, Is there a way I can get all the columns that are currently sorted and what order each of them is sorted('asc','desc')?

I mean if my table has 4 columns and the user sorted the first column to 'asc' and the third column to 'desc'
how can I get all this information? I need to save the state of the current columns with thier sort and order this is why I am asking.

Thanks!
« Last Edit: October 31, 2014, 03:15:17 AM by A-K » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 31, 2014, 06:21:12 AM »

The 'sortName' and 'sortOrder' properties store all the sorting fields and their order.
Code:
var opts = $('#dg').datagrid('options');
console.log(opts.sortName);  // output 'f1,f3'
console.log(opts.sortOrder);  // output 'asc,desc'
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #2 on: October 31, 2014, 06:23:21 AM »

Great! thanks.
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!