Ext 3 to 4 Migration issue
Hello
TypeError: m.postprocessors is undefined
Can you please help
AutoHeight grid view in ExtJs4
Hi,
I have recently started migrating my app to use ExtJs4 which previously was using ExtJs 3.X.
Now, so as to set the auto height of GridPanel in ExtJs 3.x I used to extend gridview class using code:
var autoheightgridview = ext.extend
(
ext.grid.gridview,
{
onlayout: function ()
{
ext.get(this.innerhd).setstyle("float", "none");
this.scroller.setstyle("overflow-x", "scroll");
}
}
);
but while migrating my app to ExtJs 4.2.x I have modified my code to:
Ext.define('Ext.grid.AutoHeightGridView', {
extend: 'Ext.view.Table',
onLayout: function ()
{
Ext.get(this.innerHd).setStyle("float", "none");
this.scroller.setStyle("overflow-x", "scroll");
}
});
which I guess defines a new class Ext.grid.AutoHeightGridView.
Now when i assign this class in the View property of grid panel I get error:
config is undefined if (config.grid.isTree) {
The code which I am using is:
var xg = Ext.grid;
var grid1;
grid1 = new xg.GridPanel({
store: store,
cm: cm1,
viewConfig: {
forceFit: false
},
//height: 343,
autoHeight : true,
loadMask: true,
//width: 800,
width:getAdminGridWidth(),
view: new Ext.grid.AutoHeightGridView(),
renderTo: 'bdy',
viewConfig: {
onLoad: Ext.emptyFn,
listeners: {
beforerefresh: function(v)
{
// v.scrollTop = v.scroller.dom.scrollTop;
// v.scrollHeight = v.scroller.dom.scrollHeight;
// v.scrollLeft = v.scroller.dom.scrollLeft;
// v.scrollWidth = v.scroller.dom.scrollWidth;
},
refresh: function(v)
{
// v.scroller.dom.scrollTop = v.scrollTop +
// (v.scrollTop == 0 ? 0 : v.scroller.dom.scrollHeight - v.scrollHeight);
// v.scroller.dom.scrollLeft = v.scrollLeft +
// (v.scrollLeft == 0 ? 0 : v.scroller.dom.scrollWidth - v.scrollWidth);
}
}
},
bbar: new Ext.PagingToolbar({ pageSize: 10,
store: (store), displayInfo: true, displayMsg: 'Displaying records {0} - {1} of {2}', emptyMsg:"No records to display"})
});
Can someone tell me where exactly I am going wrong? Any help will be highly appreciated.