实现easyui datagrid分页显示总记录数以便导出数据信息——2021-03-30

实现前提:datagrid在客户端分页的情况下不能利用全选checkbox选中全部数据。

实现功能:

①easyui datagrid可正常分页。

②分页新增总记录数值,以便可单页显示全部记录数用来导出列表全部数据。

dg.extendDataGrid({
     url: "/api/YH/InventoryInfo/20/1/ListByPage",
     idField: 'invCode',  //标识符-翻页勾选记忆
     singleSelect: false, 
     pagination: true,  
     columns: [[
          { field: 'ck', checkbox: true },
          { field: 'invCode', title: '产品编码', width: 80, align: 'center' },
          { field: 'invName', title: '产品名称', width: 150, align: 'center' },
          { field: 'spec', title: '规格', width: 100, align: 'center' },
          { field: 'unit', title: '单位', width: 20, align: 'center' },
          { field: 'unitPrice', title: '参考单价', width: 50, align: 'center' },
          { field: 'invCName', title: '分类名称', width: 80, align: 'center' },
          { field: 'setPartsFlag', title: '成套件', width: 30, align: 'center',
                 formatter: function (value, row, index) {
                                   return formatPartsFlag(value, row);
                            }
          },
          { field: 'safeNum', title: '安全库存量', width: 50, align: 'center' },
          { field: 'bSale', title: '销售', width: 30, align: 'center',
                 formatter: function (value, row, index) {
                                    return formatYes(value, row);
                            }
          },
          { field: 'bPurchase', title: '外购', width: 30, align: 'center',
                 formatter: function (value, row, index) {
                                    return formatYes(value, row);
                            }
          },
          { field: 'bSelf', title: '自制', width: 30, align: 'center',
                 formatter: function (value, row, index) {
                                    return formatYes(value, row);
                            }
          }],
          onDblClickRow: function (rowIndex, rowData) {     //双击行弹框查看
                                Product_List_view();
                         },
          onLoadSuccess: function (data) {
                                var total = data.total; //获取总记录数
                                var p = $('#dg-product').datagrid('getPager');
                                $(p).pagination({
                                    //实现分页条件加上总记录数total
                                    pageList: [20, 40, 60, 100, total],
                                });
                        }
          }, reg.data).datagrid('getPager').pagination({
              layout: ['list', 'sep', 'first', 'prev', 'sep', 'links', 'sep', 'next', 'last', 'sep', 'refresh', 'info']
});

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值