zoukankan      html  css  js  c++  java
  • 关于layui sort只排序当前页的问题

    done : function(res, curr, count) {
                        currentPage = curr;
                        var count = 0;
                        $(".layui-unselect").unbind('click');
                        $(".layui-unselect").find("span").eq(0).css('cursor','default');
                        $("._showTunnel").on('click',function(){
                            console.log($(this).is(":visible")); 
                            if(count % 2 == 0){
                                $("._xl").show();
                            }else{
                                $("._xl").hide();
                            }
                            count ++;
                        })
                    }
      $(".layui-table-sort-desc").css("border-top-color","#000");
    //监听排序事件 table.on('sort(test)', function(obj){ //注:sort 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值" table.reload('listTable', { initSort: obj //记录初始排序,如果不设的话,将无法标记表头的排序状态。 ,where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式) field: obj.field //排序字段 ,order: obj.type //排序方式 } }); }); });

    其次呢就是改变后台的sql语句

    <choose>
                    <when  test="field!=null and order == 'asc'.toString()">
                       order by a.HANDLE_STATUS ASC,a.ALARM_TIME DESC,a.HANDLE_TIME DESC
                    </when>
                    <otherwise>
                       order by a.HANDLE_STATUS DESC,a.HANDLE_TIME DESC,a.ALARM_TIME DESC
                    </otherwise>
             </choose>
  • 相关阅读:
    Web存储
    JavaScript模块化
    jQuery挖源码——事件绑定
    观察者模式——JavaScript
    Node.js之网络小爬虫
    ECMAScript的严格模式
    JavaScript和jQuery的事件
    认识Ajax
    Redis之intset数据结构
    Redis之Hash数据结构
  • 原文地址:https://www.cnblogs.com/a973692898/p/12105685.html
Copyright © 2011-2022 走看看