I am trying to organize my layers in the layerlistwidget based on categories, like none responsive text in between different category as in this question. My question here is, is there a way to do so without the need to group them in ArcMap?
I also experimented the the add feature collection method as in the code below in my layerlistwidget startup function(see the code ) but the groups ("myGroupLayes" and " myGroupLayes2") are not visible in the layerlistwidget, instead all layers are listed in a flat hierarchy (see the graph below).
<SPAN class="comment token">// ***begin*** added code in startup() of LayerList/widget.js </SPAN>
<SPAN class="comment token">// First group </SPAN>
<SPAN class="keyword token">var</SPAN> featureLayer1 <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">esri<SPAN class="punctuation token">.</SPAN>layers<SPAN class="punctuation token">.</SPAN>FeatureLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2FFeature" target="_blank">http://Feature</A><SPAN> layer URL"</SPAN></SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
featureLayer1<SPAN class="punctuation token">.</SPAN>title <SPAN class="operator token">=</SPAN> <SPAN class="string token">"featureLayer1"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> featureLayer2 <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">esri<SPAN class="punctuation token">.</SPAN>layers<SPAN class="punctuation token">.</SPAN>FeatureLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2FFeature" target="_blank">http://Feature</A><SPAN> layer URL"</SPAN></SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
featureLayer2<SPAN class="punctuation token">.</SPAN>title <SPAN class="operator token">=</SPAN> <SPAN class="string token">"featureLayer2"</SPAN><SPAN