It depends on if it is an onscreen widget or a widget in the widgetpool.
Here is the code that works for onscreen widget:
var pm = PanelManager.getInstance();
pm.closePanel(this.appConfig.widgetOnScreen.widgets);//close the 5th widget in the config.json inside the widgetOnScreen object
pm.closePanel(pm.activePanel);//close the active panel
Robert Scheitlin, GISP
I have been trying to close a widget when my custom widget is opened. I have used your solution above, but because the widget that I am trying to close resided in the widget pool, I have changed
I keep getting an error that reads:
TypeError: panel.setState is not a function
The widget is an "In-Panel" widget.
Would you have any idea as to why I am getting this error?
What theme are you using? A screen shot would really help.
Retrieving data ...