easyui中 datagrid排序的问题

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

1.设置 sortName,sortOrder

2.设置 remoteSort

3.设置sortable

代码  如下:

 

<table id="selectedQuestions" class="easyui-datagrid" title="试题列表" style="width: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',width:80,hidden:true">试题id</th>
                        <th data-options="field:'questionName',width:300,sortable:true">试题名称</th>
                        <th data-options="field:'questionAnwser',width:80,align:'right'">试题答案</th>
                        <th data-options="field:'status',width:80,align:'right'">试题类型</th>
                        <th data-options="field:'departmentName',width:100">所属团队</th>
                        <th data-options="field:'score',width:60,align:'center'">试题分值</th>
                        <!-- <th data-options="width:60,align:'center'"><a href="javascript:void(0)" class="easyui-linkbutton" οnclick="save();$('#dlg').dialog('close')">删除</a></th> -->
                    </tr>
                </thead>
            </table>

 

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

转载于:https://www.cnblogs.com/shaoyang/p/5553963.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值