X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/source/PagingScroller.html diff --git a/docs/source/PagingScroller.html b/docs/source/PagingScroller.html index ba649363..9c6dcfec 100644 --- a/docs/source/PagingScroller.html +++ b/docs/source/PagingScroller.html @@ -37,20 +37,20 @@ Ext.define('Ext.grid.PagingScroller', { * when scrolling up between records 0 and 34 and when scrolling down between records 65 and 99. */ percentageFromEdge: 0.35, - + /** * @cfg {Number} scrollToLoadBuffer This is the time in milliseconds to buffer load requests * when scrolling the PagingScrollbar. */ scrollToLoadBuffer: 200, - + activePrefetch: true, - + chunkSize: 50, snapIncrement: 25, - + syncScroll: true, - + initComponent: function() { var me = this, ds = me.store; @@ -58,8 +58,7 @@ Ext.define('Ext.grid.PagingScroller', { ds.on('guaranteedrange', this.onGuaranteedRange, this); this.callParent(arguments); }, - - + onGuaranteedRange: function(range, start, end) { var me = this, ds = me.store, @@ -68,7 +67,7 @@ Ext.define('Ext.grid.PagingScroller', { if (range.length && me.visibleStart < range[0].index) { return; } - + ds.loadRecords(range); if (!me.firstLoad) { @@ -83,19 +82,19 @@ Ext.define('Ext.grid.PagingScroller', { me.syncTo(); } }, - + syncTo: function() { var me = this, pnl = me.getPanel(), store = pnl.store, - scrollerElDom = this.el.dom, + scrollerElDom = this.scrollEl.dom, rowOffset = me.visibleStart - store.guaranteedStart, scrollBy = rowOffset * me.rowHeight, scrollHeight = scrollerElDom.scrollHeight, clientHeight = scrollerElDom.clientHeight, scrollTop = scrollerElDom.scrollTop, useMaximum; - + // BrowserBug: clientHeight reports 0 in IE9 StrictMode // Instead we are using offsetHeight and hardcoding borders if (Ext.isIE9 && Ext.isStrict) { @@ -103,16 +102,16 @@ Ext.define('Ext.grid.PagingScroller', { } // This should always be zero or greater than zero but staying - // safe and less than 0 we'll scroll to the bottom. + // safe and less than 0 we'll scroll to the bottom. useMaximum = (scrollHeight - clientHeight - scrollTop <= 0); this.setViewScrollTop(scrollBy, useMaximum); }, - + getPageData : function(){ var panel = this.getPanel(), store = panel.store, totalCount = store.getTotalCount(); - + return { total : totalCount, currentPage : store.currentPage, @@ -121,7 +120,7 @@ Ext.define('Ext.grid.PagingScroller', { toRecord: Math.min(store.currentPage * store.pageSize, totalCount) }; }, - + onElScroll: function(e, t) { var me = this, panel = me.getPanel(), @@ -148,8 +147,7 @@ Ext.define('Ext.grid.PagingScroller', { me.visibleStart = visibleStart; me.visibleEnd = visibleEnd; - - + me.syncScroll = true; if (totalCount >= pageSize) { // end of request was past what the total is, grab from the end back a pageSize @@ -178,29 +176,29 @@ Ext.define('Ext.grid.PagingScroller', { store.prefetchPage(nextPage); } } - - + if (me.syncScroll) { me.syncTo(); } }, - + getSizeCalculation: function() { // Use the direct ownerCt here rather than the scrollerOwner // because we are calculating widths/heights. - var owner = this.ownerCt, + var owner = this.ownerGrid, view = owner.getView(), store = this.store, dock = this.dock, elDom = this.el.dom, width = 1, height = 1; - + if (!this.rowHeight) { this.rowHeight = view.el.down(view.getItemSelector()).getHeight(false, true); } - height = store.getTotalCount() * this.rowHeight; + // If the Store is *locally* filtered, use the filtered count from getCount. + height = store[(!store.remoteFilter && store.isFiltered()) ? 'getCount' : 'getTotalCount']() * this.rowHeight; if (isNaN(width)) { width = 1; @@ -213,7 +211,7 @@ Ext.define('Ext.grid.PagingScroller', { height: height }; }, - + attemptLoad: function(start, end) { var me = this; if (!me.loadTask) { @@ -221,18 +219,18 @@ Ext.define('Ext.grid.PagingScroller', { } me.loadTask.delay(me.scrollToLoadBuffer, me.doAttemptLoad, me, [start, end]); }, - + cancelLoad: function() { if (this.loadTask) { this.loadTask.cancel(); } }, - + doAttemptLoad: function(start, end) { var store = this.getPanel().store; store.guaranteeRange(start, end); }, - + setViewScrollTop: function(scrollTop, useMax) { var owner = this.getPanel(), items = owner.query('tableview'), @@ -243,12 +241,12 @@ Ext.define('Ext.grid.PagingScroller', { calcScrollTop, maxScrollTop, scrollerElDom = this.el.dom; - + owner.virtualScrollTop = scrollTop; - + center = items[1] || items[0]; centerEl = center.el.dom; - + maxScrollTop = ((owner.store.pageSize * this.rowHeight) - centerEl.clientHeight); calcScrollTop = (scrollTop % ((owner.store.pageSize * this.rowHeight) + 1)); if (useMax) { @@ -263,8 +261,6 @@ Ext.define('Ext.grid.PagingScroller', { items[i].el.dom.scrollTop = calcScrollTop; } } -}); - - +});