// 执行页面加载的函数
    loadData(1)
  // 每页条数
var limit = 5;
// 渲染页面
function loadData(curr){ $.ajax({
type:"post",
url:'http://192.168.21.163:9974/electricity/device/getHistoryDoorAccess?modId=eb6a4c852f404e998db0901517c3d3d2&modKey=9Jqehjcj3ZRV&pageNo='+ curr +'&pageSize='+limit+'&doorIndex=c7fb6deff77b4eabb1be1709049ae742&startTime=2019-08-24T17%3A00%3A00.000%2B08%3A00&endTime=2019-11-25T22%3A00%3A00.000%2B08%3A00',
async:true,
success:function(data){
var html = '';
var msg = data.data
console.log(msg)
var list = msg.list
for(var i=0;i<list.length;i++){
if(!list[i].personDetail){
html += '<tr>'+
'<td>'+list[i].doorName+'</td>'+
'<td>'+list[i].personId+'</td>'+
'<td>'+list[i].personName+'</td>'+
'<td>'+''+'</td>'+
'<td>'+list[i].eventTime +'</td>'+
'</tr>'
}else{
html += '<tr>'+
'<td>'+list[i].doorName+'</td>'+
'<td>'+list[i].personId+'</td>'+
'<td>'+list[i].personName+'</td>'+
'<td>'+list[i].personDetail.mobile +'</td>'+
'<td>'+list[i].eventTime +'</td>'+
'</tr>'
}
}
$('#tbody').empty().html(html)
laypage(msg)
}
});
}
// 开启分页
function laypage(msg){
layui.use(['laypage', 'layer'], function(){
var laypage = layui.laypage
,layer = layui.layer;
var pages = msg.total;
//调用分页
laypage.render({
elem: 'page1'
,count: pages
,limit: limit
,curr: msg.pageNo
,jump: function(obj,first){
if(!first) { //是否首次进入页面 loadData(obj.curr);
// var currentPage = obj.curr; //获取点击的页码
// page = currentPage;
// //点击下一页或其他页码重新请求一次,将参数(当前页码)带过去即可
// loadData();
}
}
});
})
}

layui分页的使用心得的更多相关文章

  1. LayUI分页,LayUI动态分页,LayUI laypage分页,LayUI laypage刷新当前页

    LayUI分页,LayUI动态分页,LayUI laypage分页,LayUI laypage刷新当前页 >>>>>>>>>>>> ...

  2. 最易懂的layui分页

    该篇文章是在layui前端框架之分页基础上简洁化和详细化. 首先该示例采用的是Spring+MyBatis Plus+SpringMVC(常规的SSM框架),持久层换成MyBatis也行. 至于lay ...

  3. springBoot mybatis mysql pagehelper layui 分页

    <!-- 加入 pagehelper 分页插件 jar包--><dependency> <groupId>com.github.pagehelper</gro ...

  4. 二十九、layui分页插件的使用

    <div id="page1"></div> <script> //开启分页 var page = 1; function findstoreL ...

  5. tp5 设置layui分页

    \thinkphp\library\think\paginator\driver 添加 Layui.php <?php namespace think\paginator\driver; use ...

  6. SSM项目layui分页实例

    最近学了layui,发现其中的分页挺有意思的,所以整理了一下,一遍自己随时查看.(官方文档上已经很详细了,当中有不足的地方欢迎大家指出) 关于前台的js文件,css样式,js样式,大家可以到官网下 本 ...

  7. 基于MVC框架layui分页控件实现前端分页信息写法

    详细链接:https://shop499704308.taobao.com/?spm=a1z38n.10677092.card.11.594c1debsAGeak@{ ViewBag.Title = ...

  8. layui分页

    毕业已经两年,期间经历了很多.一个人欢笑与哭泣,在墙角.在路边.在床上.每天搭乘首班车来到公司,每天无数次反省自己,每天每天再问自己为什么活着. 一.下载并引用css和js 地址:点我 <lin ...

  9. js layui 分页脚本

    //分页 layui.use(['laypage'], function(){ var laypage = layui.laypage; laypage.render({ elem: 'page' , ...

随机推荐

  1. python装饰器使用详解

    装饰器 '''装饰器:就是闭包(闭包的一个应用场景) -- 把要被装饰的函数作为外层函数的参数通过闭包操作后返回一个替代版函数 优点: -- 丰富了原有函数的功能 -- 提高了程序的可拓展性''' 开 ...

  2. G.Colorful String(The Preliminary Contest for ICPC Asia Xuzhou 2019)

    https://nanti.jisuanke.com/t/4 #include <bits/stdc++.h> using namespace std; ,; typedef unsign ...

  3. 9-Perl 条件语句

    1.Perl 条件语句Perl 条件语句是通过一条或多条语句的执行结果(True或者False)来决定执行的代码块.注意,数字 0, 字符串 '0' . "" , 空 list ( ...

  4. thymeleaf 模板使用 之 解决因HTML标签未闭合引起的错误

    一.修改thymeleaf属性配置 spring.thymeleaf.prefix=classpath:/templates/ spring.thymeleaf.suffix=.html spring ...

  5. Collections 类和Arrays类常用方法详解

    1:Collections类 max(Collection <? extends T> coll):根据元素的自然顺序,返回给定集合元素中的最大元素 min(Collection < ...

  6. TreeSet——实现Comparable接口并重写CompareTo()方法

    TreeSet是以自然顺序存的数据,例如 Set<Student> students=new TreeSet(); students.add(new Student("111&q ...

  7. Eclipse错误提示: Symbol 'xxxx' could not be resolved

    在eclipse中安装maven(网上资源):https://zhinan.sogou.com/guide/detail/?id=1610049267 项目名 右键->configure-> ...

  8. cookie转换成字典类型方便scraoy 使用

    #bakooie装换成紫电模式方便scrapy使用 cookid = "_ga=GA1.2.1937936278.1538889470; __gads=ID=1ba11c2610acf504 ...

  9. eclipse中ctrl+1什么意思

    eclipse中ctrl+1是一个快捷键,能快速的现实光标所在行的问题,并给出一些修改方案. 当eclipse编辑器在你编辑代码阶段,能检测到编辑时异常(错误)会在错误代码行前面出现一个红色的叉叉,这 ...

  10. hadoop面试题(自己整理版)

    1. hadoop 运行原理2. mapreduce 原理3. mapreduce 的优化4.举一个简单的例子说下 mapreduce 是怎么运行的5. hadoop 中 combiner 的作用6. ...