tablesorter 页面不需要刷新情况下的js 神器
来源:互联网 发布:中国二手房房价数据库 编辑:程序博客网 时间:2024/06/06 00:33
参考链接 https://mottie.github.io/tablesorter/docs/example-css-highlighting.html
https://mottie.github.io/tablesorter/docs/
备注:
tablesorter 将bootstrap的 .table-hover类 导致鼠标触发hover事件 却没有相应的样式被匹配
解决方案 :
在table 加上类 .focus-highlight 并且设置样式
/* bootstrap highlight works */
table.focus-highlight, table.focus-highlight tbody > tr > td,
/* override zebra styling */
table.hover-highlight tbody tr.even > th,
table.hover-highlight tbody tr.even > td,
table.hover-highlight tbody tr.odd > th,
table.hover-highlight tbody tr.odd > td,
table.focus-highlight tbody tr.even > th,
table.focus-highlight tbody tr.even > td,
table.focus-highlight tbody tr.odd > th,
table.focus-highlight tbody tr.odd > td {
background: transparent;
}
实际操作:
a. 下载 jquery.tablesorter.min.js, tablesorter-theme/style.css 并且在页面引入
b.
常用的设置
var setting = {
headers : {0:{ sorter: false}}, // 频闭第1列
1 : {sorter:"integer"}, // 索引从0开始
2 : {sorter:"integer"}, // 第3列按照整数排列
3 : {sorter:"integer"},
4 : {sorter:"integer"},
sortList : [[1,1],[3,0]] // 设置默认排序 第2列倒序,第4列正序
};
eg:
<!DOCTYPE html><html><head> <include file="Common@Public/head" /> <script type="text/javascript" src="__JS__jquery.tablesorter.min.js"></script> <link rel="stylesheet" href="__CSS__tablesorter-theme/style.css"></head><body><include file="Common@Public/dhb_info" /><include file="Common@Public/header" /><div class="container"> <div id="breadcrumb_box"> <include file="Common@Public/nav" /> </div></div><div class="container"> <div class="panel panel-default"> <table class="table table-hover table-bordered tablesorter focus-highlight" id="table_show"> <thead> <tr> <th>field1</th> <th>field2</th> <th>field3</th> <th>field4</th> <th>field5</th> </tr> </thead> <tbody> <?php foreach($show_list as $crawler=>$show) {?> <tr> <td><?= $crawler; ?></td> <td><?= $show['total']; ?></td> <td><?= $show['login_status']; ?></td> <td><?= $show['status']; ?></td> <td><?= $show['status_report']; ?></td> </tr> <?php }?> </tbody> </table> </div></div><script type="text/javascript"> $(function () { var setting = { headers : {0:{ sorter: false}}, // 频闭第1列 1 : {sorter:"integer"}, // 索引从0开始 2 : {sorter:"integer"}, // 第3列按照整数排列 3 : {sorter:"integer"}, 4 : {sorter:"integer"}, sortList : [[1,1],[3,0]] // 设置默认排序 第2列倒序,第4列正序 }; $("#table_show").tablesorter(setting); })</script></body></html>
- tablesorter 页面不需要刷新情况下的js 神器
- JS设置隐藏或者显示,不刷新页面的情况下动态设置其显示或隐藏
- 页面刷新 的js
- 实现在父页面不刷新情况下显示子页面传递的信息
- 不需要说话的情况
- JS刷新页面的方法
- JS刷新页面的方法
- js刷新页面的方法
- js刷新页面的方法
- JS--刷新页面的函数
- 刷新页面一次的js
- 刷新页面的js方法
- js刷新页面的方式
- 在不刷新页面的情况下使用 DOM 改变网页界面
- 在不刷新页面的情况下调用远程asp脚本
- 创建Tab页并且在存在的情况下刷新页面
- junit:在不需要main的情况下运行某个方法
- 在不需要知道密码的情况下 Hacking MSSQL
- Springmvc 重定向带参数 Model 接收
- PLA总结(林轩田)
- 你应该知道的 RPC 原理
- QT中如何将写好的代码转化成单一的可执行文件
- 截取字符串
- tablesorter 页面不需要刷新情况下的js 神器
- 斯坦福大学机器学习笔记——单变量的线性回归以及损失函数和梯度下降法(包含代码)
- android studio 错误
- java中集合归纳和整理
- GNU RADIO 入门中的一个错误
- 不使用(a+b)/2这种方式,求两个数的平均值
- 【转载】MapReduce实现基本SQL操作的原理-join和group by,以及Dinstinct
- 纸牌博弈(动态规划java)
- IO流学习(一)File类的方法