Just changed one of my grids to infinite, and quite like it.
Had to write a little toolbar, since I like the 'Displaying 1 - 10 of 306' from the paging toolbar.
Have also added a refresh button... looks good.
My one concern is I seem to be able to make it hang.
Scrolling about normally seems ok, but if grab the scroller thumb and jump massively ahead, then back to start you often end up with a loading mask that never goes away.
No errors in Firebug.
Will try and figure out what's going on, but suspect it's to do with a load happening whilst another is still in progress.
This has to be rock solid, otherwise it's not an option. I love the concept though
Cheers,
Westy
Edit: My bbar for anyone that's interested; obviously you'll need to sort out the refresh yourself.
Not quite sure why the start value needs tweaking, but it's not too bad...
Code:
bbar: {
items: [
{
iconCls: 'icon-refresh',
handler: function(button) {
var grid = button.up('altus-grid');
if (grid) {
grid.refreshMaintainingSelection();
}
}
},
'->',
{
xtype: 'tbtext',
itemId: 'lblDisplayInfo'
}
]
},
...
initComponent: function() {
this.callParent(arguments);
var me = this,
view = me.getView(),
toolbarDispInfo = me.down('#lblDisplayInfo'),
verticalScroller = me.verticalScroller,
store = me.getStore(),
updateToolbarDisplayInfo = function() {
var total = store.getTotalCount();
toolbarDispInfo.setText(Ext.String.format('Displaying {0} - {1} of {2}',
verticalScroller.getFirstVisibleRowIndex() + 1,
total ? Math.min(verticalScroller.getLastVisibleRowIndex(), total) : verticalScroller.getLastVisibleRowIndex(),
total ? total : 'Unknown'));
};
me.mon(
view,
'bodyscroll',
updateToolbarDisplayInfo);
me.mon(
view,
'resize',
updateToolbarDisplayInfo);
me.mon(
store,
'prefetch',
updateToolbarDisplayInfo);
}