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

  • 相关阅读:
    TabControl添加关闭按钮
    C# 遍历窗体上控件方法
    个人JS脚本验证大全[转]
    c# 窗体位置任意调
    Sql存储过程解密算法 破解微软的加密算法
    网页居中
    兼容IE和Firefox的设为首页和收藏的Javascript代码
    定义类成员
    HikariCP
    post请求重定向到get请求问题
  • 原文地址:https://www.cnblogs.com/shaoyang/p/5553963.html
Copyright © 2011-2022 走看看