加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ajax json 表格排序,分页,自定义每页数量

发布时间:2020-12-16 00:30:31 所属栏目:百科 来源:网络整理
导读:ajax json 表格排序,分页,自定义每页数量 点击表头可以排序,按照升序或者降序,另外支持多列排序 设置每页数量 演示 XML/HTML Code table id = 'example3' thead tr th ID / th th Firstname / th th Lastname / th Grade / th Grade2 / th Efficiency /

ajax json 表格排序,分页,自定义每页数量

点击表头可以排序,按照升序或者降序,另外支持多列排序

设置每页数量

演示

XML/HTML Code
  1. <tableid='example3'>
  2. thead>
  3. tr>
  4. th>ID</th>
  5. th>Firstname</th>
  6. th>Lastname</th>Grade</th>Grade2</th>Efficiency</th>Age</th>Company</</tr>
  7. thead>
  8. tbody>
  9. tbody>
  10. table>

JavaScript Code

    <scripttype='text/javascript'>
  1. $(function(){
  2. $.ajax({
  3. url:"example3.json",
  4. dataType:"json"
  5. }).done(function(data){
  6. console.log(data);
  7. $("#example3").slimtable({
  8. tableData:data
  9. });
  10. }).fail(function(param1,param2){
  11. console.log("error:"+param2);
  12. });
  13. </script>

example3.json

XML/HTML Code
    [
  1. ["1","ex1","ex_a","2,5","2.5","30%","19","ex_a1"],
  2. ["2","ex2","ex_b","5,4","5.4","28,5%","33","ex_b1"],
  3. ["3","ex3","ex_c","16,7","16.7","19,3%","ex_c1"],0);">["4","ex4","ex_d",8","2.8","1,8%","28",0);">["5","ex6","ex_e",85%","44",0);">["6","ex7","ex_f","5.5","16%","52","ex_d1"],0);">["7","ex8","ex_g","6,"6.8",9%","39","ex_e1"],0);">["8","ex9","ex_h","freejs.net"]
  4. ]


原文地址: http://www.freejs.net/article_fenye_156.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读