View Full Version : infinite scroll grid height

5 Jun 2012, 2:33 PM
Is there a way to have the height of an infinite scroll grid shrink to fit the number of rows when the store returns fewer records than would be required to fill the configured height?

7 Jun 2012, 9:05 AM
Not that I am aware of. I have used the following in previous apps, perhaps it may help:

// call on grid.afterlayout / resize

calculatePageSize: function() {
if (!this.rendered) { return false; }

var row = this.view.getRow(0);
var rowHeight;

if (!row) { rowHeight = 41; }
else { rowHeight = Ext.get(row).getHeight(); }

var height = this.getView().scroller.getHeight();

var ps = Math.floor(height / rowHeight);
return (ps > 1 ? ps : false);


15 Jun 2012, 3:03 AM
I have the same problem. And searching for a solution.

@Scott, it seems that your code is Ext 3.x, the functions you are using are not available anymore. If someone has a tip on how to access a row EL from the view I guess one could reuse your code, but I couldn't see a way to do it. Dom-Query perhaps?