zoukankan      html  css  js  c++  java
  • easyui中 datagrid排序的问题

    今天做了datagrid排序的问题,也搜集了很多,但是很多好像不太行,醉后 看到一个可以,和在easyui 一个demo有点类似,easyui中的是多行,现在我们来说一说一行怎么处理

    1.设置 sortName,sortOrder

    2.设置 remoteSort

    3.设置sortable

    代码  如下:

    <table id="selectedQuestions" class="easyui-datagrid" title="试题列表" style="800px;height:400px"
                        data-options="rownumbers:true,singleSelect:false,pagination:true, sortName:'questionName',sortOrder:'asc' remoteSort:false">
                    <thead>
                        <tr>
                            <th data-options="field:'ck',checkbox:true"></th>    
                            <th data-options="field:'id',80,hidden:true">试题id</th>
                            <th data-options="field:'questionName',300,sortable:true">试题名称</th>
                            <th data-options="field:'questionAnwser',80,align:'right'">试题答案</th>
                            <th data-options="field:'status',80,align:'right'">试题类型</th>
                            <th data-options="field:'departmentName',100">所属团队</th>
                            <th data-options="field:'score',60,align:'center'">试题分值</th>
                            <!-- <th data-options="60,align:'center'"><a href="javascript:void(0)" class="easyui-linkbutton" onclick="save();$('#dlg').dialog('close')">删除</a></th> -->
                        </tr>
                    </thead>
                </table>

    其中:remoteSort 这个一定要写,默认是true 要写成false

  • 相关阅读:
    Cooperate with Myself
    A brief introduction of myself
    计算1+11+111+1111+........
    Jav实现F(n)=F(n-1)+F(n-2)+.....+F(1)+1
    查找二维数组中是否有符合的目标值
    排序算法
    时间复杂度
    Java代码实现单例模式
    查找一个字符串中重复出现字符的个数
    null,“”,empty的区别
  • 原文地址:https://www.cnblogs.com/shaoyang/p/5553963.html
Copyright © 2011-2022 走看看