JavaScript
Run Code
Open in Fiddle
Ext.require([ 'Ext.ux.ajax.JsonSimlet', 'Ext.ux.ajax.SimManager' ]); Ext.define('Ext.ux.ajax.JsonSimletWithTotal', { extend: 'Ext.ux.ajax.DataSimlet', alias: 'simlet.jsonwithtotal', doGet: function (ctx) { var me = this, page = [], i, j, reader = ctx.xhr.options.proxy.reader, ret = me.callParent(arguments), // pick up status/statusText response = {}; for (i = ctx.params.start, j = 0; i < ctx.params.start + ctx.params.limit; i++, j++) { page[j] = { test: "test " + i } }; response[reader.getRootProperty()] = page; response[reader.getTotalProperty()] = 1200000; ret.responseText = Ext.encode(response); return ret; } }); Ext.application({ name: 'Broken scrolling for very long infinite scrolling', launch: function() { Ext.ux.ajax.SimManager.register({ 'remote-data.php': { stype: 'jsonwithtotal' } }); window.grid = Ext.create("Ext.grid.Panel", { renderTo: Ext.getBody(), id: "grid_one", title: "Try to drag scrollbar to the bottom", height: 500, width: 300, tbar: [{ text: 'Scroll to bottom', handler: function() { this.up('gridpanel').getScrollable().scrollTo(null, Infinity); } }], store: { autoLoad: true, buffered: true, pageSize: 100, fields: [{ name: "test" }], proxy: { type: 'ajax', url: 'remote-data.php', reader: { type: 'json', rootProperty: 'page_contents' } } }, columns: { items: [{ text: "Test", dataIndex: "test", flex: 1 }] } }); } });