zoukankan      html  css  js  c++  java
  • 重写 Ext.toolbar.Paging 扩展功能

    直接代码,放项目overrides文件夹中即可

    //重写类 分页插件
    //汉化
    //默认下方布局
    //默认显示额外信息
    //当删除数据时,处理页面变化
    Ext.define("override.toolbar.Paging", {
        override: "Ext.toolbar.Paging",
        displayMsg: '显示 {0} - {1} 条,共 {2} 条',
        emptyMsg: '没有要显示的数据',
        beforePageText: '第',
        afterPageText: '页,共 {0} 页',
        firstText: '第一页',
        prevText: '上一页',
        nextText: '下一页',
        lastText: '最后一页',
        refreshText: '刷新',
        dock: 'bottom',
        displayInfo: true,
        //新增remove监听
        getStoreListeners: function () {
            return {
                beforeload: this.beforeLoad,
                load: this.onLoad,
                exception: this.onLoadError,
                remove: this.onRemoveRecords
            };
        },
        //当删除数据时
        onRemoveRecords: function (store, records) {
            var me = this,
            //当前页数据总数
            count = store.getCount(),
            //当前页码
            currentPage = store.currentPage,
            //页面总数
            pageCount = me.getPageData().pageCount,
            //数据总数
            totalCount = store.getTotalCount();
            //当前页已经没有数据
            if (count == 0) {
                if (pageCount == currentPage) {
                    //如果是最后一页,显示上一页
                    me.movePrevious();
                } else {
                    //不是最后一页,刷新
                    me.doRefresh();
                }
            } else {
                //重新设置数据总数
                store.totalCount = totalCount - records.length;
                //刷新页面
                me.updateInfo();
            }
        }
    });
  • 相关阅读:
    Java常见问题汇总
    前端url参数中带有callback并产生错误
    shiro中ecache-core版本引起的异常
    深入SpringMVC注解
    导出表格数据到excel并下载(HSSFWorkbook版)
    layui数据表格及分页
    签名的生成
    程序的健壮性Robustness
    ASP.NET MVC中注册Global.asax的Application_Error事件处理全局异常
    生成二维码功能
  • 原文地址:https://www.cnblogs.com/mlzs/p/5595765.html
Copyright © 2011-2022 走看看