|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/6/2008 1:24:22 AM
Posts: 1,
Visits: 5
|
|
I have an interesting puzzle. This works perfectly in a standard HTML page, but I can't seem to get it working in ExtJS.
Here is what I do in the HTML:
1) Draw a chart (with Fusion) in a DIV tag.
2) Reference the DIV tag in javascript to call setDataURL. This updates the chart data without a full page reload
So, In Extjs:
1) Draw the chart in the HTML div
2) Load the DIV into a Panel using contentEl
3) call setDataURL on the chart DIV from a handler function.
4) **** ERROR! I get an error that chart DIV doesn't exist. This is weird, because Firebug show it in the DOM inspector
Can someone help me sort this one out.
The Javascript is:
var chart1 = new FusionCharts("Charts/ScrollLine2D.swf", "chartHistory", "900", "400", "0", "1");
function updateHandler1(){
var nf = Ext.get('g1feed').getValue();
var st = Ext.get('g1term').getValue();
var dt = Ext.get('g1date').getValue();
var newurl = '/v7/chartxml.php?'+ 'nf=' + nf + '&st='+ st + '&dt=' + dt;
Ext.Msg.alert('New URL is', newurl);
var chartObj = getChartFromId(chartHistory);
chartObj.setDataURL(newurl);
}
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Today @ 6:58:37 AM
Posts: 632,
Visits: 1,928
|
|
hi,
I went through your problem. Please try the solution stated below :
var newurl = '/v7/chartxml.php?'+ 'nf=' + nf + '&st='+ st + '&dt=' + dt;
// please add this line for url encode
newurl = escape(newurl );
// chartHistory must be with in quotes
var chartObj = getChartFromId("chartHistory");
i think it will solve your problem
Arindam
Thanks,
Arindam FusionCharts Team
www.fusioncharts.com
|
|
|
|