Hi everyone.
I have a little question, tried everything that I can, but is it possible to close the panel automatically, when start a widget? It's originally an off-panel widget, but I would like to group it... I want this, when open:
Not this:
Thanks your help,
John
Solved! Go to Solution.
John,
This widget is not designed at all to be used this way. But This is what you would need to change:
Add 'jimu/PanelManager', PanelManager to the define array and vars then add Line 14 below.
onOpen: function() {
this.setToggleLayer();
var lObjs = [];
array.map(this.toggleLayerIds, lang.hitch(this, function(id){
var lyrNode = this.layerStructure.getNodeById(id);
lObjs.push(lyrNode);
}));
if (!this.isToggling) {
this.isToggling = true;
this.toggleLayer(lObjs);
setTimeout(lang.hitch(this, function() {
this.isToggling = false;
WidgetManager.getInstance().closeWidget(this);
PanelManager.getInstance().minimizePanel(this.getPanel());
if(lObjs[0].isToggledOn()){
domClass.add(this.parentContainer, "jimu-state-selected");
}else{
domClass.remove(this.parentContainer, "jimu-state-selected");
}
}), 300);
}
},
John,
This widget is not designed at all to be used this way. But This is what you would need to change:
Add 'jimu/PanelManager', PanelManager to the define array and vars then add Line 14 below.
onOpen: function() {
this.setToggleLayer();
var lObjs = [];
array.map(this.toggleLayerIds, lang.hitch(this, function(id){
var lyrNode = this.layerStructure.getNodeById(id);
lObjs.push(lyrNode);
}));
if (!this.isToggling) {
this.isToggling = true;
this.toggleLayer(lObjs);
setTimeout(lang.hitch(this, function() {
this.isToggling = false;
WidgetManager.getInstance().closeWidget(this);
PanelManager.getInstance().minimizePanel(this.getPanel());
if(lObjs[0].isToggledOn()){
domClass.add(this.parentContainer, "jimu-state-selected");
}else{
domClass.remove(this.parentContainer, "jimu-state-selected");
}
}), 300);
}
},
Thanks your quick help, it works well!!