直接代码,放项目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();
}
}
});

重写 Ext.toolbar.Paging 扩展功能的更多相关文章

  1. [转载]ExtJs4 笔记(12) Ext.toolbar.Toolbar 工具栏、Ext.toolbar.Paging 分页栏、Ext.ux.statusbar.StatusBar 状态栏

    作者:李盼(Lipan)出处:[Lipan] (http://www.cnblogs.com/lipan/)版权声明:本文的版权归作者与博客园共有.转载时须注明本文的详细链接,否则作者将保留追究其法律 ...

  2. ExtJs4 笔记(12) Ext.toolbar.Toolbar 工具栏、Ext.toolbar.Paging 分页栏、Ext.ux.statusbar.StatusBar 状态栏

    本篇讲解三个工具栏控件.其中Ext.toolbar.Toolbar可以用来放置一些工具类操控按钮和菜单,Ext.toolbar.Paging专门用来控制数据集的分页展示,Ext.ux.statusba ...

  3. 重写 Ext.form.field 扩展功能

    直接代码,放项目overrides文件夹中即可 //重写类 表单父类 //支持allowBlank动态绑定 Ext.define("override.form.field.Base" ...

  4. Extjs-工具条和菜单 Ext.menu和Ext.Toolbar

    转载自:http://blog.csdn.net/itlwc/article/details/7878002 1.创建一个简单工具条效果图 <script type="text/jav ...

  5. [ExtJS5学习笔记]第八节 Extjs5的Ext.toolbar.Toolbar工具条组件及其应用

    本文地址:http://blog.csdn.net/sushengmiyan/article/details/38515499 本文作者:sushengmiyan ------------------ ...

  6. 重写Ext中的typeOf函数

    重写Ext中的typeOf函数来解决Ext JS中typeOf对字符串对象.元素节点.文本节点.空白文本节点判断并不准确的问题 重写的typeOf函数使用自己实现的TypeOf函数2中的代码 测试代码 ...

  7. Ext.Toolbar.Fill()

    tbar : ['-',new Ext.form.Label({ text : '产品代码:' }),new Ext.form.TextField({ id : 'cpdm', name : 'cpd ...

  8. Ext分页实现(前台与后台)

    Ext分页实现(前台与后台)Spring+Mybatis 一.项目背景 关于Ext的分页网上有很多博客都有提到,但是作为Ext新手来说,并不能很容易的在自己的项目中得以应用.因为,大多数教程以及博客基 ...

  9. 【extjs】 extjs5 Ext.grid.Panel 搜索示例

    先看效果图: 页面js: <script type="text/javascript"> /** * 日志类型 store * */ var logTypeStore ...

随机推荐

  1. 在Eclipse添加Android兼容包( v4、v7 appcompat )

    昨天添加Android兼容包,碰到了很多问题,在这里记录一下,让后面的路好走. 如何选择兼容包, 请参考Android Support Library Features(二) 一.下载Support ...

  2. [算法] [常微分方程] [欧拉法 改进欧拉法 经典R-K算法]

    #include<iostream> #include<cmath> #include<cstdio> #include<iomanip> using ...

  3. 辐射4 中文武器命名方法, 不用winhex, 直接游戏内操作

    参考资料:https://www.reddit.com/r/fo4/comments/3t354b/tip_you_can_add_text_formatting_italic_underline/h ...

  4. [BTS] System.Xml.Schema.XmlSchemaException: The complexType has already been declared when generate IDoc schema.

    I use wcf-sap adapter for generate the schema of IDoc that named "YHREMPMASTER". but throw ...

  5. How to use AKBusGpsParser

    step 01: sudo easy_install AKBusGpsParser step02: Let's see a sample #!/usr/bin/python #coding:UTF-8 ...

  6. JavaScript-语法基础

    在学习任何一门编程语言之前,我们都需要了解这门语言并学习这么语言的语法基础,掌握语法基础之后才可以进行一门语言的使用,本文在这里将详细介绍JavaScript的语法基础,使得以后能够快速的进行Java ...

  7. Python之Web框架们

    Python的WEB框架 Bottle Bottle是一个快速.简洁.轻量级的基于WSIG的微型Web框架,此框架只由一个 .py 文件,除了Python的标准库外,其不依赖任何其他模块. pip i ...

  8. .NET开发中经常用到的扩展方法

    整理一下自己经常用到的几个扩展方法,在实际项目中确实好用,节省了不少的工作量. 1  匿名对象转化 在WinForm中,如果涉及较长时间的操作,我们一般会用一个BackgroundWorker来做封装 ...

  9. C#创建唯一的订单号, 考虑时间因素

    主要是想把日期和其它因素考虑进来. 使用RNGCryptoServiceProvider类创建唯一的最多8位数字符串. private static string GetUniqueKey() { ; ...

  10. Java中long和Long有什么区别 (转载)

    “Long is a class. long is a primitive. That means Long can be null, where long can't. Long can go an ...