Launch a widget from a button but not have a panel/UI

472
2
12-13-2018 10:21 AM
sreeharikottoormadam
New Contributor III

Is there a  way to launch a widget from a button but not have a panel/UI?   

- I have a custom widget (widget A) and within that, from a button click user need to open another widget  (widget B) , but widget B should not added to the UI/panel. 

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Sreehari,

  If you have a widget that is developed to not have a panel (ie. the manifest.json has "inPanel": false,) then you can call if from a button using the code in this link:

https://community.esri.com/thread/219253-open-widget-programatically-foldable-theme 

sreeharikottoormadam
New Contributor III

Hi Robert,

Thanks for the help. This worked for me (Launchpad Theme).

var widgetsCfg = this.appConfig.widgetPool.widgets;
var widgetId;
for(var i in widgetsCfg){
if(widgetsCfg.name == "MyWidget_Name"){
widgetId = widgetsCfg.id;
break;
}
}
var widgetCtlr = WidgetManager.getInstance().getWidgetsByName("AnchorBarController")[0];
widgetCtlr.setOpenedIds([widgetId]);

0 Kudos