I have a div.

<div class="left_panel box animate fadeInLeft three" id="layers"  style="display:none;">
            <div class="sidebar-head">
                <h2>layers</h2>
                <div>Content Here</div>
                <div class="tab-close"> < </div>

            </div>
        </div>

Inside this Div I want my LayerControl widget to be placed.

layerControl: {
            include: true,
            id: 'layerControl',
            type: 'domNode',
            srcNodeRef: 'layerTOC',
            path: 'gis/dijit/LayerControl', 
            title: 'Layers',
            open: true,
            position: 0,
            options: {
            map: true,
            layerControlLayerInfos: true,
            separated: true,
            vectorReorder: true,
            overlayReorder: true,
                               layerInfos: [
                                      {
                            layer: cities,
                            type: 'dynamic',
                            title: 'i18n.viewer.operationalLayers.cities',
            controlOptions: {
            noZoom:false,
            swipe:false
 }
 }
            ]}
            },

When you use this:

srcNodeRef: 'layerTOC',

with a domNode widget, you need an HTML element with that target ID (layerTOC). So your HTML should look something like this:

<div class="left_panel box animate fadeInLeft three" id="layers" style="display:none;"> <div class="sidebar-head"> <h2>layers</h2> <div id="layerTOC">Content Here</div> <div class="tab-close"> < </div> </div> </div>

and the element <div id="layerTOC">Content Here</div> will be replaced by the widget.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.