Ext ComboBox分页太长了,去掉一些(1)

Ext.ns("Ext.wv");		//自己来个命名空间,以免和别人同名;

// 为下拉框重写一个分页条;
Ext.wv.ComboPagingToolbar = Ext.extend(Ext.PagingToolbar, {
	// 重写onRender
	onRender : function(ct, position) {
		Ext.PagingToolbar.superclass.onRender.call(this, ct, position);
		this.first = this.addButton({
					tooltip : this.firstText,
					iconCls : "x-tbar-page-first",
					disabled : true,
					handler : this.onClick.createDelegate(this,
							["first"])
				});
		this.prev = this.addButton({
					tooltip : this.prevText,
					iconCls : "x-tbar-page-prev",
					disabled : true,
					handler : this.onClick.createDelegate(this,
							["prev"])
				});

		// /this.addSeparator();

		// this.add(this.beforePageText);
		this.field = Ext.get(this.addDom({
					tag : "input",
					type : "text",
					size : "3",
					value : "1",
					cls : "x-tbar-page-number"
				}).el);
		this.field.on("keydown", this.onPagingKeydown, this);
		this.field.on("focus", function() {
					this.dom.select();
				});
		this.afterTextEl = this.addText(String.format(
				this.afterPageText, 1));
		this.field.setHeight(18);
		this.field.setWidth(0); // //隐藏input
		this.afterTextEl.hide(); // 隐藏文字;

		// this.addSeparator();

		this.next = this.addButton({
					tooltip : this.nextText,
					iconCls : "x-tbar-page-next",
					disabled : true,
					handler : this.onClick.createDelegate(this,
							["next"])
				});
		this.last = this.addButton({
					tooltip : this.lastText,
					iconCls : "x-tbar-page-last",
					disabled : true,
					handler : this.onClick.createDelegate(this,
							["last"])
				});

		// this.addSeparator();

		this.loading = this.addButton({
					tooltip : this.refreshText,
					iconCls : "x-tbar-loading",
					handler : this.onClick.createDelegate(this,
							["refresh"])
				});

		if (this.displayInfo) {
			this.displayEl = Ext.fly(this.el.dom).createChild({
						cls : 'x-paging-info'
					});
		}
		if (this.dsLoaded) {
			this.onLoad.apply(this, this.dsLoaded);
		}
	}
});

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值