EasyUI Forum
September 13, 2025, 04:41:07 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: Auto Sort not working  (Read 9272 times)
swells808
Newbie
*
Posts: 15


View Profile
« on: November 08, 2014, 08:34:23 AM »

Hello all. I was able to turn sorting on my columns so I can manually click on the headers to order things but I am having an issue making it happen manually. I am trying to set my grid so it sorts the shift column ascending then the date column after that.

My first try was to add the following code to the get users php file:
Code:
$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 20;
$sort = isset($_POST['sort']) ? strval($_POST['sort']) : 'shift';
$order = isset($_POST['order']) ? strval($_POST['order']) : 'asc';
$offset = ($page-1)*$rows;

Then I went into the html and added this:
Code:
<body bgcolor="#3d3d3d">
<table id="dg" title="Flight Assignment" class="easyui-datagrid" style="width:1000px;height:650px"
url="get_users.php"
toolbar="#toolbar"
data-options="
pagination:true,
pageSize:20,
rownumbers:true,
fitColumns:true,
singleSelect:true,
remoteSort:true,
multiSort:true,
                ">
<thead>
<tr>
<th data-options="field:'shift',width:50,sortable:true">SHIFT</th>
<th data-options="field:'date',width:80,sortable:true">DATE</th>
This allowed me a sheet that worked but, I had to manually sort. My next step was to add
Code:
sortName:shift,
sortOrder:asc,
in the data-options area but that broke the page. I even tried changing remoteSort:true but, that didn't help either. What am I missing? Thanks.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: November 08, 2014, 05:02:47 PM »

The 'sortName' and 'sortOrder' properties must be string values.
Code:
sortName:'shift,date',
sortOrder:'asc,asc',
Logged
swells808
Newbie
*
Posts: 15


View Profile
« Reply #2 on: November 10, 2014, 12:54:08 PM »

Thank you that moved it!
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!