I am using a developer edition of web appbuilder to build a information viewer (government service) only using a NearMe Widget. This application will be mainly used by small screen smart phones. I set this widget to open when it starts. When this widget or any other widgets open on a smart phone, a max button icon appears so that the widget window can be fully expanded for easier use. When it opens first, the widget only opens on a half of the screen on a phone. See the attached. Left image is when it opens. The right image is right after max button is clicked. I would like to set this nearMe widget to open as a full screen on a phone when it starts. We can't assume the public will know to click on a max button when they use this application.
Is there anyway that I can set the max-button to true when the nearMe widget starts? I only need to control this NearMe widget for a specific web application.
Thanks,
SJ
Solved! Go to Solution.
SJ,
So for the LaunchPad theme you have to make this change to the Panel.js in the
[install dir]\server\apps\[app#]\themes\LaunchpadTheme\panels\LaunchpadPanel\Panel.js
startup: function(){
this.inherited(arguments);
this.panelManager.normalizePanel(this);
if(this.label === 'Near Me'){
this.maxNode.click();
}
},
SJ,
In your apps jimu.js/OnScreenWidgetPanel.js make this change to the onOpen function:
onOpen: function() {
if (this._resizeOnOpen) {
this.resize();
this._resizeOnOpen = false;
}
if (window.appInfo.isRunInMobile) {
if(this.label === 'Near Me'){
this.maxNode.click();
}
this._setMobilePosition();
}
this.inherited(arguments);
},
Good afternoon Robert,
I added the code, but the widget still opens as a half screen. I have to click on the max button to make it expanded.
Would you please try it on your phone?
https://gis.columbiasc.gov/coc
Thanks,
SJ
SJ,
You did not mention you were using the Launchpad theme. I will have to look to see what changes have to be made for that theme.
SJ,
So for the LaunchPad theme you have to make this change to the Panel.js in the
[install dir]\server\apps\[app#]\themes\LaunchpadTheme\panels\LaunchpadPanel\Panel.js
startup: function(){
this.inherited(arguments);
this.panelManager.normalizePanel(this);
if(this.label === 'Near Me'){
this.maxNode.click();
}
},
Robert's suggestion on adding two lines of code on panel.js was perfectly working for Launchpad theme.
Thanks,
SJ
Robert,
It works beautifully.
Thank you so much.
SJ
Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.