So with the GREAT patience and help of Nick at ESRI...using WAB Developer v1.2
You can edit the Widget.js file to expand the layers automatically so that when you
click on the widget the layers are expanded. Edit the LayerListView.js file to hide a layer added individually or as a group.
Sample Code: Widget.js (place at end of startup function and find id in chrome developer tools)
...
widget2Expand= this;
setTimeout(function () {
var layer1Table = document.querySelectorAll("[layercontenttrnodeid='id2Expand']")[0].childNodes[0].childNodes[0];
var img = document.getElementsByClassName("showLegend-image")[0];
widget2Expand.layerListView._onRowTrClick(widget2Expand.operLayerInfos._layerinfos[0], img, layer1Table.childNodes[0], layer1Table);
}, 500);
...
Sample Code: LayerListView.js (find id in chrome developer tools)
array.forEach(layerInfo.newSubLayers, lang.hitch(this, function (level, subLayerInfo) {
console.info(subLayerInfo);
if (subLayerInfo.id != "id2hide") {
this.drawListNode(subLayerInfo, level + 1, nodeAndSubNode.subNode); //hide sublayer
}
//this.drawListNode(subLayerInfo, level + 1, nodeAndSubNode.subNode);
}, level));
},
Cheers,
Mona