I managed to have a grouped layers list, however, the problem I have is that when I use the "openAll" option (not the drop-down option), and because I have so many groups, when I start the app it shows all the groups open (first figure). I can collapse them manually (figure 2), but I am trying to find out how can I have just one expanded when I start the app?
This thread may help:
https://community.esri.com/thread/201369-wab-how-do-i-edit-the-group-widget-layout
Thanks, Robert Scheitlin, GISP. I exactly did what you said, and also checked these codes as well (https://community.esri.com/thread/237493-is-it-possible-to-collapse-multiple-layer-lists-by-default ). I still get strange results, where the titles of all my sub-groups are gone!
Here is also part of mu Config.json code:
Erfan,
So it looks like you are having the issue that has been addressed in the second threads code. The important part is the setTimeout in the code below (line 24):
createFoldableBtn: function() {
this.foldableNode = html.create('div', {
'class': 'foldable-btn',
'role': 'button',
'aria-label': this.headerNls.foldWindow,
'tabindex': 0
}, this.btnsContainer);
this.own(on(this.foldableNode, 'click', lang.hitch(this, function(evt){
evt.stopPropagation();
this.onFoldableNodeClick();
})));
this.own(on(this.foldableNode, 'keydown', lang.hitch(this, function(evt) {
if(evt.keyCode === keys.ENTER || evt.keyCode === keys.SPACE){
evt.stopPropagation();
this.onFoldableNodeClick();
}else if(evt.keyCode === keys.TAB && evt.shiftKey){
evt.preventDefault();
}
})));
if(this.openfolded){
setTimeout(lang.hitch(this, function(){
this.onFoldableNodeClick();
}), 500);
}
},
I exactly have the same code there:
Still, I am getting the strange behavior from this though!
Sorry I am not sure then.
When I start the app it seems it wants to load it as I want (we expect), but suddenly it goes wrong:((