X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FPagingToolbar.js;h=dd1f615edac3f778158115d76561d1084b7eec5d;hb=0b69a11b1055a6d3a3fd0719bdd58b5a235de0e4;hp=55b8cc3e9aede7eabf700fe6c5b71e57c3d03f57;hpb=3e450d1b506cc1cd74732d99c9a59b902ace072d;p=roojs1 diff --git a/Roo/PagingToolbar.js b/Roo/PagingToolbar.js index 55b8cc3e9a..dd1f615eda 100644 --- a/Roo/PagingToolbar.js +++ b/Roo/PagingToolbar.js @@ -27,9 +27,9 @@ Roo.PagingToolbar = function(el, ds, config) el = config.container; } var items = []; - if (this.items) { - items = this.items; - this.items = []; + if (config.items) { + items = config.items; + config.items = []; } Roo.PagingToolbar.superclass.constructor.call(this, el, null, config); @@ -37,10 +37,12 @@ Roo.PagingToolbar = function(el, ds, config) this.cursor = 0; this.renderButtons(this.el); this.bind(ds); - var _this = this; + + // supprot items array. + Roo.each(items, function(e) { - _this.add(Roo.factory(e)); - }); + this.add(Roo.factory(e)); + },this); }; @@ -230,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;