How can I configure the default size of a Panel?
I want to start a widget within a small panel.
Thanks!
Solved! Go to Solution.
First one must get the instance of the PanelManager. What worked for me was
var pm = PanelManager.getInstance().getPanelById(this.id + '_panel');
pm.resize({h:720});
Thanks for the example. This works for me except on initial load of the widget. Tried it in postCreate, startup, onOpen... based on the lifecycle of a widget docs, onOpen is the last to be called so currently have it there. Opening the first time the widget size does not resize but after closing and reopening then the resize does work each time thereafter.
It seems to be a timing issue because if I put a breakpoint on this line then let it continue, it works on initial load too. Also, if I add a setTimeout for like 1 second it works. Anyone know if there is an event to subscribe to for whatever else needs to happen first?
BTW, I am doing this in a Portal 10.8.1 web app custom widget, not stand alone WAB.
Hi @RyanCoodey ,
I know this is an old thread but I ran into the same issue and found a solution on this page https://support.esri.com/en/technical-article/000025937 . I was missing....
panel.setPosition(panel.position); panel.panelManager.normalizePanel(panel);
var pm = PanelManager.getInstance();
var panelID = pm.activePanel.id;
var activePanel = pm.getPanelById(panelID);
activePanel.position.width = 669;
activePanel.setPosition(activePanel.position);
activePanel.panelManager.normalizePanel(activePanel);