custom (SL expander) panes in JS layerlist widget? possible?

2767
4
Jump to solution
09-23-2015 02:20 PM
Ravichandran_M_Kaushika
Occasional Contributor

dear Readers,

thank you for taking the time to read this posting.  We want to implement an expander like behavior on the left side frame for layer list.  categorize each type of layer into different Silverlight like expander content panes.  after searching around, found this:

http://dojotoolkit.org/reference-guide/1.10/dijit/TitlePane.html#accordioncontainer-substitute

we copied and pasted the code in a custom / no frills / plain widget and it worked.  we later on decided to use it in layer list widget.  the expander/ improved accordion behavior did not happen in layer list out of the box widget.

Purpose: we want to separate the layers into 3 to 4 separate expander like 'controls' to minimize clutter on the screen and organize the layers.  any idea even if it is different is fine.

regards

ravi.

0 Kudos
1 Solution

Accepted Solutions
TracySchloss
Frequent Contributor

Could you please post your code in the forum?  It's possible you have a misplaced opening or closing div tag.

View solution in original post

0 Kudos
4 Replies
TracySchloss
Frequent Contributor

Could you provide some sample code?  I routinely use TitlePanes in my work, and I've loaded all sorts of different widgets into them without any problems.

When I use them, I always add an empty div tag within the titlePane to serve as the container for the widget,as opposed to using the main titlePane div. 

<div id="legendPane" data-dojo-type="dijit/TitlePane" data-dojo-props="title: 'Map Legend', closable:false, open:true" >

    <div id="legendDiv"></div>

</div>

0 Kudos
Ravichandran_M_Kaushika
Occasional Contributor

Tracy Schloss,

good afternoon. thanks for replying to my email. I had copied an pasted the contents of the website: pane 1, pane 2 in the above URL (1st post of mine) - I had copied to 2 widgets. One widget that was obtained from about page or with no real items on the widget.  the other widget was the layer list widget. I did not do any mods to the layer list widget.  the accordion/ expander style behavior did not happen in the layer list widget; but happened in the plane widget (home / about).

I had added the references dijit/Titlepane in the html style and in the .js page for the required section.

thanks for your time.

regards

ravi.

0 Kudos
TracySchloss
Frequent Contributor

Could you please post your code in the forum?  It's possible you have a misplaced opening or closing div tag.

0 Kudos
Ravichandran_M_Kaushika
Occasional Contributor

I asked an ESRI employee Mike R. for help.  His take on the issue:

while creating a widget inside a widget, we should include _WidgetsInTemplateMixin item.

'dijit/_WidgetsInTemplateMixin'  in

define([...'dojo/dom'... 'dojo/query'... 'dijit/_WidgetsInTemplateMixin'...],

          function (..., ...., dijit/_WidgetsInTemplateMixin'.... ]

{

var clazz = declare ([BaseWidget,  _WidgetInTemplateMixin], {,,,,,

after that we pasted the code in html and that fixed.

I will mark the answer provided by Tracy Schloss for the benefit of other readers.

status; FIXED.

regards

ravi.

0 Kudos