在jsp文件中,使用Extjs定义了一个panel0,在这个panel下面嵌套定义了另外一个panel1,然后在这个panel1里面想显示一个FusionChart控件,但是总是提示 chartid.render() Error >> Unable to find the container DOM element 错误,var cp = Ext.getCmp("Panel0");
var ccp = Ext.getCmp("Panel1");
if(ccp != null){
cp.remove(ccp);
}
var Panel1 = new Ext.Panel({
id:'Panel1',
width:480,
height:400,
html:'<div id="ccPanel"></div>'
});cp.add(Panel1 );
cp.doLayout();
var Chart = new FusionCharts("../../FusionCharts/Column3D.swf", "ChartId", 400,300, "0", "1");
Chart.setJSONData(JSONData);
Chart.render("ccPanel");google下提示,可能是因为“Rendering FusionCharts with script in one frame/window and the container HTML element being on another frame/window is not yet supported with FusionCharts”,具体也没有明白。如果这样不可行,那么是否可以这样new Ext.Panel({
title:'图',
height: 480,
html:'<iframe frameborder="0" width="400" height="300" scrolling="no" src="chart.html"/>'
})
然后在chart.html中,显示FusionCharts,现在关键是怎么把数据JSONData同时传递给chart.html
var ccp = Ext.getCmp("Panel1");
if(ccp != null){
cp.remove(ccp);
}
var Panel1 = new Ext.Panel({
id:'Panel1',
width:480,
height:400,
html:'<div id="ccPanel"></div>'
});cp.add(Panel1 );
cp.doLayout();
var Chart = new FusionCharts("../../FusionCharts/Column3D.swf", "ChartId", 400,300, "0", "1");
Chart.setJSONData(JSONData);
Chart.render("ccPanel");google下提示,可能是因为“Rendering FusionCharts with script in one frame/window and the container HTML element being on another frame/window is not yet supported with FusionCharts”,具体也没有明白。如果这样不可行,那么是否可以这样new Ext.Panel({
title:'图',
height: 480,
html:'<iframe frameborder="0" width="400" height="300" scrolling="no" src="chart.html"/>'
})
然后在chart.html中,显示FusionCharts,现在关键是怎么把数据JSONData同时传递给chart.html
试试改成window不行么
var Panel1 = new Ext.Panel({
html : "<div id='ccPanel'></div>"
});var win = new Ext.Window({
frame : true,
width : 500,
height : 400,
title : "图",
shadow : true,
modal : true,
items : [Panel1]
});
win.show();
var Chart = new FusionCharts("../../FusionCharts/Column3D.swf", "ChartId", 400,300, "0", "1");
Chart.setJSONData(JSONData);
Chart.render("ccPanel");
new Ext.Panel({
title:'图',
height: 480,
html:'<iframe frameborder="0" width="400" height="300" scrolling="no" src="chart.html"/>'
})
在chart.html对应的chart.js中可以显示,这个主要的问题是如何把参数JSONData传递给chart.js