Your constants might change based on whether you restructure your components on the Viewport. In this case, I just included one constant/variable named "ROW_HEIGHT". The goal is to eliminate the vertical scroll bar in all cases, no matter which device the MVC application is viewed on (ie: iPhone, Android, iPad, Android Tablet, Mac, PC, etc...). In ExtJS 4.2, I've found that a value of 21 creates a scroll bar if the resolution gets too small or the size of the browser gets smaller. Having too small of a value (like 20) will give a blank row in some situations at the bottom of the grid. I've found 21.1 to be the Goldilox height if you just have the default grid with no themes applied, and you're inheriting (extending) the standard Ext.grid.Panel component. So change according to your test cases for your application.
Utilities class:
Ext.define('App.Utilities', {
statics: {
APP_NAME: 'MVC',
ROW_HEIGHT: 21.1
}
});
Ext.grid.Panel view lisenters:
listeners: {
resize: function(view, width, height, oldWidth, oldHeight, eOpts) {
height = this.body.getHeight(true);
var rows = Math.floor(height / App.Utilities.ROW_HEIGHT);
view.getStore().pageSize = rows;
view.getStore().load();
}
}