EasyUI Forum
May 04, 2024, 10:03: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: how to show a sort name&order icon when a datagrid is successfully loaded  (Read 17167 times)
bakerchen
Newbie
*
Posts: 9


View Profile Email
« on: April 08, 2013, 09:30:40 PM »

After a datagrid is successfully loaded, there is no default sort icon indicator displayed on the table header.
You need click a column of table header to see a sort icon.

my question is: can I set a default sort name&order and show a sort icon when a datagrid is successfully loaded at the first time? no need user to click the column of table header.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: April 10, 2013, 07:24:34 AM »

Please download the updated datagrid plugin from http://www.jeasyui.com/easyui/plugins/jquery.datagrid.js to solve this issue.
Logged
bakerchen
Newbie
*
Posts: 9


View Profile Email
« Reply #2 on: April 10, 2013, 09:04:56 PM »

Thanks for quick response.
Is there any updated documents or demo to guide me?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: April 11, 2013, 06:22:15 PM »

Please refer to this example http://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=Sorting
Logged
bakerchen
Newbie
*
Posts: 9


View Profile Email
« Reply #4 on: April 11, 2013, 07:40:16 PM »

Thank you stworthy.
I can see it works well as what I expect on the live demo.

But it looks like this does not work on my test page, what's wrong with me?
I have downloaded the updated datagrid plugin file you gave on the previous thread to my site.

here is my part html codes.

         <table id="dg-user" class="easyui-datagrid"
               title=""
               iconCls="toolabar-icon-gear"
               fit="true"   
               pagination="false"
               sortName="username" sortOrder="asc" 
               data-options="rownumbers:false,singleSelect:false,fitColumns:true,url:'ajax.user.php'"> 
            <thead> 
               <tr> 
                  <th data-options="field:'id',checkbox:true"></th> 
                  <th field="username" width="200" sortable="true">Username</th> 
                  <th field="realname" width="200" sortable="true">Realname</th> 
                  <th field="email" width="200" sortable="true">Email</th>
                  <th field="date_created" width="150" formatter="formatUnixTimeStamp" align="center" sortable="true">Date Created</th> 
                  <th field="date_last_visit" width="150" formatter="formatUnixTimeStamp" align="center" sortable="true">Last Visited</th>
                  <th field="status" width="70" align="center" formatter="formatStatus" sortable="true">Status</th>                  
               </tr> 
            </thead> 
         </table>
 
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!