I'm attempting to add a context menu to the TOC widget provided by nliu here: http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.09/src/agsjs/dijit/TOC.jsI can get the context menu to appear however, it cannot see the data associated with the node.
// (Within the PostCreate function)
var pMenu;
pMenu = new Menu({});
pMenu.addChild(new MenuItem({
label: "Turn On",
onClick: this._manualTurnOn
}));
pMenu.startup();
pMenu.bindDomNode(this.rowNode);
// (Reference - Code above was added before this section shown below)
if (this.containerNode) {
domStyle.set(this.containerNode, 'display', showChildren ? 'block' : 'none');
}
I add a _manualTurnOn function and was hoping to interact with the serviceLayer using this context menu (as well as some other functions later). However, when the function is triggered, there doesn't appear to be any context of the TOCNode object that was used to create the node this Menu is associates. It's clear I'm misunderstanding how this widget is structured (possibly even how widgets actually work).Any clue how I might retrieve/interact with the underlying data associated with the node?