PDA

View Full Version : Strange message on Panel.setTitle()



acherniak
19 Dec 2011, 2:32 PM
I am trying to modify a header of the "west" panel with the following code:

<html>
<head><title>test</title>
<link rel="stylesheet" type="text/css" href="ext-4.0.7/resources/css/ext-all.css" />
<script type="text/javascript" src="ext-4.0.7/ext-all-debug.js"></script>
<script type="text/javascript">
Ext.onReady(function () {
var n=0,
westPanel = new Ext.Panel({ region: 'west', split: true, collapsible: true,
width: '40%', autoScroll: true,collapseFirst: false, title: 'View'
}),
viewport = new Ext.Viewport({ layout: "border",
items: [ westPanel,
{ region: 'center', title: 'Center',
tools: [{ id: 'gear',
handler: function () { westPanel.setTitle('View '+n++); }}
]
}
]
});
})
</script>
<body></body></html>
It seems to work fine, even after I collapse the panel, but after I expand it back, the following message appears in Firefox Console every time I modify the header: Unexpected value matrix(NaN,NaN,NaN,NaN,NaN,NaN) parsing transform attribute.
Is it normal?

mitchellsimoens
19 Dec 2011, 2:55 PM
What version are you using? I tried on 4.0.7 and this works just fine (your code cleaned up a little):


var n = 0,
viewport = Ext.create('Ext.container.Viewport', {
layout : 'border',
items : [
{
region : 'west',
split : true,
collapsible : true,
width : '40%',
autoScroll : true,
collapseFirst : false,
title : 'View'
},
{
region : 'center',
title : 'Center',
tools : [
{
type : 'gear',
handler : function () {
var viewport = this.up('viewport'),
west = viewport.down('panel[region=west]');

west.setTitle('View ' + n);

n++;
}
}
]
}
]
});

acherniak
20 Dec 2011, 5:36 AM
I am using 4.0.7 too. Mitchell's code has exactly the same problem which is relatively easy to re-produce: (1) load the page, (2) collapse and expand the west region, (3) click the gear tool, (4) collapse the west...
The worst behavior is in Firefox. Unexpected value matrix... appears in the console, subsequent collapse leaves an empty vertical bar (no header text and no >> tool). In IE and Opera header text gets cropped to various degree, but expand tool button stays. Chrome seems to work OK.

mitchellsimoens
20 Dec 2011, 5:46 AM
As I said, it worked just fine for me.

friend
20 Dec 2011, 11:18 AM
I encountered the same problem as acherniak on Firefox 5.0.1, using Firebug. The problem starts occurring immediately after you collapse and re-expand the west panel...

ldonofrio
20 Dec 2011, 11:46 AM
+1 too

skirtle
20 Dec 2011, 5:17 PM
Agreed, I can reproduce it using Mitchell's code and 4.0.7. As others have noted, the steps are:


Collapse the west region.
Expand the west region.
Click the gear.
Collapse the west region.


In FF8 it breaks both the title and expand tool. In Chrome the title is in the wrong place. Clicking the gear again fixes it.

In 4.1-pr1 the failure is different and much easier to reproduce. With that version the collapsed title shows in the right place but never updates.