Select to view content in your preferred language

Legend dijit issue

740
3
Jump to solution
12-10-2012 08:00 AM
SamirGambhir
Frequent Contributor
Hi all,
I have an issue with the legend dijit in my application. I have a function 'generateRenderer' that generates a renderer and a legend, but this function has to run twice to display the legend. I have attached a simplified code for review. I'll appreciate your help in resolving this issue.
I am using ArcGIS Server 10.1 instance with JavaScript 3.2
Thanks
Samir
0 Kudos
1 Solution

Accepted Solutions
SamirGambhir
Frequent Contributor
Hi,
The attached sample is really simplified and highlights the issue with legend dijit. Can someone please run it and help me resolve this issue?
Thanks
Samir


I found the solution to this issue. Creating legendDijit should have been within "onComplete" event of GenerateRendererTask. I had placed this outside.
Thanks
Samir

View solution in original post

0 Kudos
3 Replies
SamirGambhir
Frequent Contributor
Hi all,
I have an issue with the legend dijit in my application. I have a function 'generateRenderer' that generates a renderer and a legend, but this function has to run twice to display the legend. I have attached a simplified code for review. I'll appreciate your help in resolving this issue.
I am using ArcGIS Server 10.1 instance with JavaScript 3.2
Thanks
Samir


Hi,
The attached sample is really simplified and highlights the issue with legend dijit. Can someone please run it and help me resolve this issue?
Thanks
Samir
0 Kudos
SamirGambhir
Frequent Contributor
Hi,
The attached sample is really simplified and highlights the issue with legend dijit. Can someone please run it and help me resolve this issue?
Thanks
Samir


I found the solution to this issue. Creating legendDijit should have been within "onComplete" event of GenerateRendererTask. I had placed this outside.
Thanks
Samir
0 Kudos
JeffPace
MVP Alum
you could have probably created it before and just called legend.refresh() in the oncompleteevent as well
0 Kudos