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:
$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:
<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
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.