EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: TampaBay55 on February 28, 2015, 08:14:56 AM



Title: Datagrid Sort
Post by: TampaBay55 on February 28, 2015, 08:14:56 AM
Greetings:

How do I retrieve the current sort order for a datagrid?  If I wish to insert a record into the grid then I will need to know WHERE to insert it based on the sort order.  Thank you.


Title: Re: Datagrid Sort
Post by: stworthy on March 01, 2015, 07:59:55 AM
Call 'options' method to get the datagrid's options, in which you can retrieve current sort name and sort order.
Code:
var opts = $('#dg').datagrid('options');
var name = opts.sortName;
var order = opts.sortOrder;
console.log(name+"|"+order);


Title: Re: Datagrid Sort
Post by: TampaBay55 on March 01, 2015, 02:37:07 PM
Thank you kindly.