Hello.
I have a WAB application at version 2.16. There is a custom widget, which is set "visible: false," in the application's config.json. I would like to change it as visible if the log in user is in a permitted group. According to this discussion, Show hide layers widget based on Portal Named user level , I add the following codes to this custom widget.js postCreate module. But the code never hits to postCreate module. Where should I put those lines of codes?
thanks so much.
<SPAN class=""></SPAN><SPAN class=""> postCreate: function () {
console.log('postCreate');
var widgetCfg = this._getWidgetConfig('MyCustomWidget');
widgetCfg.visible = true;
if(window._layoutManager.params.urlParams.mode === 'config'){
topic.publish('builder/widgetChanged', widgetCfg);
}else{
topic.publish('widgetChanged', widgetCfg);
}
},</SPAN>