首页 新闻 会员 周边

.net中MVC的layui数据表格table问题

0
悬赏园豆:10 [已关闭问题] 关闭于 2018-08-01 16:53

本人初学layui,同时也是程序员小白

public ActionResult GetList(string api, string requestBody, string logType, string requestType, string ip, DateTime? startTime, DateTime? endTime, string pIndex, string pSize)
        {
            int pageIndex = 1;
            int pageSize = 20;
            if (!string.IsNullOrEmpty(pIndex))
            {
                pageIndex = int.Parse(pIndex);
            }
            if (!string.IsNullOrEmpty(pSize))
            {
                pageSize = int.Parse(pSize);
            }
            #region 设置时间默认值
            if (startTime == null)
            {
                startTime = DateTime.Now.AddDays(-10);
            }
            if (endTime == null)
            {
                endTime = DateTime.Now;
            }
            #endregion
            #region 设置查询条件
            int? logT = null;
            if (!string.IsNullOrEmpty(logType))
            {
                logT = int.Parse(logType);
            }
            int? requestT = null;
            if (!string.IsNullOrEmpty(requestType))
            {
                requestT = int.Parse(requestType);
            }
            #endregion
            var result = QueryLogsByCondition(null, logT, requestT, ip, null, api, null, null, requestBody, null, null, (DateTime)startTime, (DateTime)endTime, pageIndex, pageSize).Data;
            var list = result.List;
            return Json(new { code = 0, msg = "", count = result.PageInfo.TotalCount, data = list }, JsonRequestBehavior.AllowGet);
        }

近期在使用layui数据表格table的分页功能,但后端分页信息如今设定了int pageIndex = 1;
 int pageSize = 20俩默认值,有什么办法从前端传这俩个值回来,因为如果pageSize设成最大值int.int.MaxValue,由于数据量过大,显示会很慢同时会数据异常(毕竟数据量太大了),如果使用layui中的laypage控件,倒是能解决问题,毕竟可以jump: function(obj, first){}!但如果我要只用table的分页,那该怎么解决?望各位大神不吝赐教!!!万分感谢!!!

Edward華的主页 Edward華 | 初学一级 | 园豆:143
提问于:2018-06-19 15:21
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册