Select to view content in your preferred language

Having issue of Legend.startup() in IE8

666
1
Jump to solution
08-23-2013 07:50 AM
tonylife
Occasional Contributor
When doing Legend.startup() in IE8, I am hitting an error on following function in widget.js of 3.5 API

createLegend: function() {     var _695 = false;      _672.set(this.domNode, "position", "relative");     ...... }


The problem is, this.domNode is null in IE8.

Chrome works fine, and this.domNode suppose to be "<div id="legendDiv" widgetid="legendDiv"></div>"

This div is the container of the Legend, I created it dynamically using jquery, right before creating legend.

            var legendCp = new dijit.layout.ContentPane({                 title: GISViewer.i18n.tools.legend.title,                 selected: true,                 region: 'center',                 id: "legendPanel"             });              dijit.byId('stackContainer').addChild(legendCp);             dojo.addClass(dojo.byId('legendPanel'), 'panel_content');              $('#legendPanel').append('<div id="legendDiv" widgetid="legendDiv"></div>');              var legendDijit = new esri.dijit.Legend({                 map: GISViewer.map,                 layerInfos: layerInfo             }, 'legendDiv');               if (dojo.isIE === 8 || dojo.isIE === 9) {                 setTimeout(function () {                     legendDijit.startup();                 }, 500);             } else {                 legendDijit.startup();             }


Please help on this.

Thanks,
Tony
0 Kudos
1 Solution

Accepted Solutions
tonylife
Occasional Contributor
It's my code issue.

I have some code ruined domNode of legend.
The code is supposed to run after startup of legend, but it get run before that because of the timer I set for IE8.

Thanks for visiting.
Tony

View solution in original post

0 Kudos
1 Reply
tonylife
Occasional Contributor
It's my code issue.

I have some code ruined domNode of legend.
The code is supposed to run after startup of legend, but it get run before that because of the timer I set for IE8.

Thanks for visiting.
Tony
0 Kudos