Refresh agsjs.dijit.TOC and esri.dijit.Legend after adding an additional Service

775
3
08-06-2012 08:43 PM
ReddaiahPurma
New Contributor
Is it possible to rebind or refresh agsjs.dijit.TOC and esri.dijit.Legend if i add an additional Service dynamically after  loading the complete map page along with TOC and Legend.....
0 Kudos
3 Replies
StephenLead
Regular Contributor III
Is it possible to rebind or refresh agsjs.dijit.TOC and esri.dijit.Legend if i add an additional Service dynamically after  loading the complete map page along with TOC and Legend.....


You can detect when a layer is added to the map by listening for map.onLayerAdd(). You can then refresh the legend using legend.refresh(). The TOC probably has an equivalent refresh method.

Steve
0 Kudos
ReddaiahPurma
New Contributor
You can detect when a layer is added to the map by listening for map.onLayerAdd(). You can then refresh the legend using legend.refresh(). The TOC probably has an equivalent refresh method.

Steve


Thanq Steve.....

I have fixed that for Legend but for TOC i cant find any refresh method....
var inltoc=dijit.byId("inlineDiv");
inltoc.layerInfos=layerInfocv;

By this i am able to bind new Layers to TOC but unable to reflect that in "inlineDiv"
0 Kudos
StephenLead
Regular Contributor III
for TOC i cant find any refresh method....


Hmmmm - I can't see anything, either. The author's contact details are included in the script - perhaps you could try asking him directly?

Steve
0 Kudos