PDA

View Full Version : [CLOSED][3.1] Flash Chart produces error on Refresh



mikecar
6 Feb 2010, 3:43 AM
Ext version tested:


Ext 3.1.0 released
Ext 3.1.x svn (as of Feb 6,2010)



Adapter used:


ext



css used:


only default ext-all.css



Browser versions tested against:


IE6
FF3 (firebug installed)



Operating System:


WinXP Pro



Description:


When a flash chart component is data-bound, and a datachange event
occurs in the store, while the chart is non-visible, (for any reason,
either because it belongs to a hidden tab, is programmatically hidden,
or whatever), an error occurs in the refresh method of the component,
line 333


this.swf.setDataProvider(dataProvider);
saying that "this.swf.setDataProvider is not a function"



Test Case:
Attached. The file needs minor editing to set the correct Ext paths
according to your local setup. It shows the most complex case, using
TabPanels. the bug is reproducible without a tabPanel, though. I have
a simpler case at hand, if anybody needs it. The reason I am posting the
"complex" case, is that, on the simple case (just a panel), some of the
work-arounds seem to work, but break down on the complex case.

Steps to reproduce the problem:


Open the file. use FireFox, with FireBug activated
Press the button "load". See the grid populated
Switch to the "pie" tab. See the pie get drawn
Switch to the "grid" tab.
Pres "load" again.
Error message is generated in FireBug Console



Debugging already done:


I pinpointed the error to the refresh method of the chart component, and
verified that it occurs whenever the component, or any of its parents is hidden.
In simple cases, setting the hideMode of the container fixes the issue,
but this is layout-dependent.



Possible fix:


The only reliable work-around I have found is this:
Make sure that whenever the container of the chart is hidden, the chart is
completely destroyed, and, when it is shown again, the chart is re-created from
scratch. Not nice, but it works in every case. Everything else I tried would break
in either IE and/or FF



I believe this bug is in the heart of many threads talkin about "charts not being redrawn properly",
especially in IE-class browsers.

evant
7 Feb 2010, 3:50 PM
Thanks for the detailed report, we have a ticket currently open for this. Marking as closed.