FusionCharts Forum: this scope delegate issue for link=javascript - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

this scope delegate issue for link=javascript

#1 User is offline   mikegiddens 

  • Forum Newbie
  • Group: Members
  • Posts: 3
  • Joined: 16-October 07

Posted 18 March 2010 - 01:18 PM

I am looking for a way to not call functions to the window document but to the map object or some other specified scope.



Quote


var map = new FusionMaps(this.fusionmapPath + mapInfo.swf, mapInfo.swf, mapInfo.width, mapInfo.height, this.debug, "0");

map.setDataURL( {dataurl} );

map.render(this.body.dom);

map.newFunction = function( data ) {

console.log("This is my data", data);

}





if I do a basic log in FF I get Window to be this and the scope of the object.

Quote


< entity id="AL" value="1270" link="JavaScript:console.log(this, 'AL', 'Alabama', 'AL', 'Tuscaloosa County');">





My question is:

Is there any way to change the scope of this to be something else when the Javascript is called?
0

Other Replies To This Topic

#2 User is offline   Sudipto Choudhury 

  • Supreme Being
  • Group: Administrators
  • Posts: 1919
  • Joined: 19-March 07

Posted 23 March 2010 - 11:10 PM

Hi,



I am afraid, there is no direct way to do so, the FusionCharts JavaScript object and the chart object are two separate elements as well when you call a JavaScript function from a chart's link it takes window scope.
Regards,

Sudipto Choudhury
FusionCharts Team

Follow us on Twitter

I code, therefore I am.

0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic