PDA

View Full Version : [SOLVED!] Upgrading from Ext3.1 to 3.2.0 js error: this.lastSize is undefined



JoyfulBobHome
6 Apr 2010, 6:19 AM
I receive this error in moving from 3.1 to 3.2.0. I've got 3 grids inside a viewport's center region, and panels in the west and east regions. I searched the forums and saw that lastSize is tied to the height/width, so I ensured I had heights and/or autoHeight:true on all my grids and panels, and I still get this error. Tried searching the docs on lastSize but couldn't find anything. Not sure what to check at this point.

Here's my viewport, followed by the panel and grid definitions:



var viewport = new Ext.Viewport({
id: 'viewport',
layout:'border',
stateful: false,
items:[
new Ext.BoxComponent({
region:'north',
hidden:true,
height:32
}),{
region:'west',
id:'west-panel',
title:'IT Central 1.0<br>' + Ext.get('usrpf').dom.value + ' / ' + Ext.get('dividdesc').dom.value,
split:true,
width: 200,
height: 400,
minSize: 175,
maxSize: 400,
collapsible: true,
collapsed: true,
collapseMode: 'mini',
margins:'0 0 0 5',
layout:'accordion',
layoutConfig:{
animate:true
},
items: [
{ title:'Miscellaneous', items: miscMenu }]
},
centerPanel
,{
region:'east',
id:'east-wing',
title:'Maintenance',
split:true,
width: 400,
height: 400,
minSize: 200,
maxSize: 700,
collapsible: true,
collapsed: true,
collapseMode: 'mini',
margins:'0 5 0 0',
layoutConfig:{ // Turn off to increase performance
animate: false
},
layout: 'fit', // specify layout manager for items
items: [ eastPanel ]
}
]
});
...
var centerPanel = new Ext.Panel({
region:'center',
id:'center-panel',
style: {textAlign: 'center'},
//title:'IT Central 1.0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + Ext.get('usrpf').dom.value + ' / ' + Ext.get('dividdesc').dom.value,
width: 200,
height: 400,
minSize: 175,
maxSize: 400,
collapsible: false,
collapsedMini: true,
margins:'5 0 0 0',
layout:'accordion',
autoScroll:true,
...
var eastPanel = new Ext.TabPanel({
id:'eastPanel',
deferredRender: false,
border: false,
activeTab:0,
autoHeight: true,
height: 400,
...
Ext.apply(this,{
id: 'wrkEditGrid',
store: wrkDataStore, // the datastore is defined here
cm: wrkColumnModel, // the columnmodel is defined here
plugins:[this.action, this.expander],
view: wrkGV,
clicksToEdit:1,
cls: 'centerAccordianHdr',
stripeRows: true,
width: 850,
//autoHeight: true,
height: 400,
autoScroll: true,
layout:'fit',
loadMask: true,
border:false,
...


This also throws the same error:

wrkGV.toggleGroup( wrkGV.getGroupId( Ext.get('weekDay').dom.value ));

CodeKnocker
13 Apr 2010, 11:35 PM
Same problem here........

JoyfulBobHome
21 Apr 2010, 9:37 AM
bump...

FYi, this also happens in another pre-v3.2 app that I tried to convert.

JoyfulBobHome
27 Apr 2010, 6:11 AM
Can somebody please help us on this? We really need an answer. It's holding up our entire upgrade to V3.2. I see other posts with this error but no solution. I suspect others are experiencing this in upgrading to V3.2.

If ext-all-debug.js gave us more info we could possibly track this down - at least the component name that it's happening on.

JoyfulBobHome
28 Apr 2010, 5:45 AM
I figured it out from a different post that wasn't related to this at all.

You need to override the syncHeight fnc.

Here's the code in case anyone else run's into this problem:


Ext.override(Ext.Panel, {
syncHeight : function(){
if(!(this.autoHeight || this.duringLayout)){
var last = this.lastSize;
if(last && !Ext.isEmpty(last.height)){
var old = last.height, h = this.el.getHeight();
if(old != 'auto' && old != h){
var bd = this.body, bdh = bd.getHeight();
h = Math.max(bdh + old - h, 0);
if(bdh != h){
bd.setHeight(h);
var sz = bd.getSize();
this.fireEvent('bodyresize', sz.width, sz.height);
}
}
}
}
}
});

Joyfulbob
25 Apr 2012, 6:51 AM
So this works however now the CPU usage is running at 11-15% with the app doing nothing.

If I comment out the code in the previous post, CPU usage goes away. So the question is, what in this code is causing the browser to keep running? We're using V3.3.1.


Ext.override(Ext.Panel, {
syncHeight : function(){
if(!(this.autoHeight || this.duringLayout)){
var last = this.lastSize;
if(last && !Ext.isEmpty(last.height)){
var old = last.height, h = this.el.getHeight();
if(old != 'auto' && old != h){
var bd = this.body, bdh = bd.getHeight();
h = Math.max(bdh + old - h, 0);
if(bdh != h){
bd.setHeight(h);
var sz = bd.getSize();
this.fireEvent('bodyresize', sz.width, sz.height);
}
}
}
}
}
});

I tried Profile in FireBug and got this (see attachment).

mlbartonsr
1 May 2012, 1:25 PM
Did you find out why it is using cpu cycles?

Joyfulbob
1 May 2012, 1:28 PM
No; I don't understand Override code that much; especially if it's Ext code. I thought this was for the layout only ,and once it was rendered this code would stop executing, but I was mistaken.

Joyfulbob
16 May 2013, 5:38 AM
We're running into this again on the SyncHeight method in a grid toolbar. It's looking for a height on the toolbar; but we never define one??

Here's the grid and toolbar code:



var tcnEditGrid = new Ext.extend(Ext.grid.EditorGridPanel, {

initComponent: function() {
...
Ext.apply(this,{
id: 'tcnEditGrid',
store: tcnDataStore, // the datastore is defined here
cm: tcnColumnModel, // the columnmodel is defined here
view: tcnGV,
clicksToEdit:1,
stripeRows: true,
width: 900,
loadMask: true,
border:false,
frame:false,
stateful: true,
// trackMouseOver: true, // use??
viewConfig:{emptyText:'No rows to display'},
selModel: tcnSelModel,
tbar: [{
text: 'Add Contacts', tooltip:'Add new Contacts', handler: this.displayFormWindow.createDelegate(this),
iconCls: 'add', id: 'tcnAddButton'
},{
text: 'Delete selected Contacts', tooltip:'Delete selected row(s)', handler: this.confirmDeleteSITCNT.createDelegate(this),
iconCls: 'remove', id: 'tcnDeleteButton'
} , '-',{
text: 'Import Contacts', tooltip:'Import Contact(s) from another Site#', handler: this.importContacts.createDelegate(this),
iconCls: 'copy', id: 'tcnCopyButton'
},{
text: 'Double-click Item to edit', xtype: 'tbtext', id: 'tcnGridInstruct', tooltip:'Double-click to edit', height: 25
}]
}); // end of apply

tcnEditGrid.superclass.initComponent.apply(this,arguments);
...

43826

Joyfulbob
17 May 2013, 11:58 AM
bump