PDA

View Full Version : Chart in tabpanel cause ie errors.



cokeetang
9 Nov 2009, 7:12 PM
I added a chart in the tabpanel and it works fine with ie. But when I close the tab-panel with the X botton, an error happened with IE while ff was fine any way.
Error msg:
object doesn't support this action ext-all.js..
and the contents of the tab would be empty but didn't close at all.
Then I wanted to close the tab again and another msg came out with "'disabled' is null or not an object".
Code like this:

result_tabs.add({
closable: true,
items:new Ext.Panel({
title: 'ExtJS.com Visits Trend, 2007/2008 (No styling)',

width:500,
height:300,
layout:'fit',

items: {
xtype: 'linechart',
store: new Ext.data.JsonStore({
fields:['name', 'visits', 'views'],
data: [
{name:'Jul 07', visits: 245000, views: 3000000},
{name:'Aug 07', visits: 240000, views: 3500000},
{name:'Sep 07', visits: 355000, views: 4000000},
{name:'Oct 07', visits: 375000, views: 4200000},
{name:'Nov 07', visits: 490000, views: 4500000},
{name:'Dec 07', visits: 495000, views: 5800000},
{name:'Jan 08', visits: 520000, views: 6000000},
{name:'Feb 08', visits: 620000, views: 7500000}
]
}),
xField: 'name',
yField: 'visits'
}
})});

10 Nov 2009, 7:57 AM
are you calling results_tab.doLayout() afterwards?

Animal
10 Nov 2009, 8:04 AM
Why wrap the chart in a Panel? Why not just add the chart to the TabPanel????

cokeetang
11 Nov 2009, 3:07 AM
Everything works fine before I close the tab. After close the tab, the tab button was still there with nothing in the continer.http://content.screencast.com/users/coekeetang/folders/Jing/media/5a31158b-dba2-4cec-9e19-1c02ff9ad793/2009-11-11_1858.png

Animal
11 Nov 2009, 3:22 AM
So, did you try adding the chart directly instead of wrapping it in a Panel?

suntsu
5 Jan 2010, 11:28 PM
Same error for me...
And my chart was already added directly to the Tab Panel...
I'll continue to look for a fix but if someone get any hint...

kjleng
6 Jan 2010, 1:45 PM
What version of Ext JS are you using? In 3.0.3 we've been having all sorts of problems when destroying our charts.

Every once in a while the chart is being passed a refresh boolean during removal. But this is after it's store is destroyed, and it throws an error as it tries to refresh, when it should be destroyed.

Our fix was to set the chartComponent's isInitialized=false right before it is removed.

Also, in IE we found that we could not destroy the chart that had a custom tip renderer without it throwing an error.

Our hack fix for a quick release was to add the following into the destroy of a panel containing the chart.

if(Ext.isIE){
this.chart.tipFnName = "";
}

this.chart being the reference to your chart.

This was just for a quick same-day solution. We are looking into a real solution right now.

That last IE fix is a bug reported a few times:
http://www.extjs.com/forum/showthread.php?t=88375
http://www.extjs.com/forum/showthread.php?t=87883