PDA

View Full Version : Calling a JS function in a Panel



flightcom
19 Jul 2010, 4:48 AM
Hi,
I'm a beginner with Sencha and I'm trying to modify the existing example of Kitchen Sink to fit with my needs. I work with some charts generated by Google API (i send some values and it return me the chart's URL) So in the html tag of the Panel I put an img tag and call a JS function to define the src. But it doesn't seem to works. Here is the code :


demos.envois.Histo.totalJ = new Ext.Panel({
cls : 'card card1',
html : "<img id='carte' src='afficher2('carte', 'barChart', 'Envois', 0, 'total', 'jour')' />"
});

Can someone tell me how to do please ?

evant
19 Jul 2010, 4:52 AM
You can't do that.



var src = afficher2('carte', 'barChart', 'Envois', 0, 'total', 'jour');
demos.envois.Histo.totalJ = new Ext.Panel({
cls : 'card card1',
html : '<img id="carte" src="' + src+ '" />'
});

flightcom
19 Jul 2010, 5:00 AM
It works now :) Thank you evant !