X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FPagingToolbar.js;h=dd1f615edac3f778158115d76561d1084b7eec5d;hb=61bc45258e16a779856dd2ad0862630b489e4583;hp=635ab0f8e24fce6885427570f496e0db50e780af;hpb=4d9cd83949f3c24871af08cebb30b1f8102ac4c9;p=roojs1 diff --git a/Roo/PagingToolbar.js b/Roo/PagingToolbar.js index 635ab0f8e2..dd1f615eda 100644 --- a/Roo/PagingToolbar.js +++ b/Roo/PagingToolbar.js @@ -26,13 +26,24 @@ Roo.PagingToolbar = function(el, ds, config) ds = el.dataSource; el = config.container; } - + var items = []; + if (config.items) { + items = config.items; + config.items = []; + } Roo.PagingToolbar.superclass.constructor.call(this, el, null, config); this.ds = ds; this.cursor = 0; this.renderButtons(this.el); this.bind(ds); + + // supprot items array. + + Roo.each(items, function(e) { + this.add(Roo.factory(e)); + },this); + }; Roo.extend(Roo.PagingToolbar, Roo.Toolbar, { @@ -114,7 +125,7 @@ Roo.extend(Roo.PagingToolbar, Roo.Toolbar, { disabled: true, handler: this.onClick.createDelegate(this, ["prev"]) }); - this.addSeparator(); + //this.addSeparator(); this.add(this.beforePageText); this.field = Roo.get(this.addDom({ tag: "input", @@ -127,7 +138,7 @@ Roo.extend(Roo.PagingToolbar, Roo.Toolbar, { this.field.on("focus", function(){this.dom.select();}); this.afterTextEl = this.addText(String.format(this.afterPageText, 1)); this.field.setHeight(18); - this.addSeparator(); + //this.addSeparator(); this.next = this.addButton({ tooltip: this.nextText, cls: "x-btn-icon x-grid-page-next", @@ -140,7 +151,7 @@ Roo.extend(Roo.PagingToolbar, Roo.Toolbar, { disabled: true, handler: this.onClick.createDelegate(this, ["last"]) }); - this.addSeparator(); + //this.addSeparator(); this.loading = this.addButton({ tooltip: this.refreshText, cls: "x-btn-icon x-grid-loading", @@ -221,8 +232,9 @@ Roo.extend(Roo.PagingToolbar, Roo.Toolbar, { { var v = this.field.dom.value, pageNum; var increment = (e.shiftKey) ? 10 : 1; - if(k == e.DOWN || k == e.LEFT || k == e.PAGEDOWN) + if(k == e.DOWN || k == e.LEFT || k == e.PAGEDOWN) { increment *= -1; + } if(!v || isNaN(pageNum = parseInt(v, 10))) { this.field.dom.value = d.activePage; return;