how to change the width and height of the custom widget pragmatically in launchpad theme?

3187
6
Jump to solution
02-04-2016 06:51 AM
MS2
by
New Contributor II

how to change the width and height of the custom  widget pragmatically in launchpad theme?. Setting in config file using position key and using the below code is not working for me. Is it a bug or am i missing something?

var pos = {  
           
          width: '600px',  
          height: '500px'  
        };
html.setStyle(this.domNode, pos);
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Mouli,

   These two threads will help explain why you can not do this in the config.json like other themes:

Launchpad theme and panelmanager problem

Layer List auto start location change

View solution in original post

6 Replies
RobertScheitlin__GISP
MVP Emeritus

Mouli,

   These two threads will help explain why you can not do this in the config.json like other themes:

Launchpad theme and panelmanager problem

Layer List auto start location change

MS2
by
New Contributor II

Thanks for your reply Robert. I want to change the size of the window after some user events( like on a button click), not on start up or from some other widget.  I tried the below line and its not giving me the expected result. Any help will be appreciated. Thanks in advance.

this.setPosition(pos);
PanelManager.getInstance().normalizePanel(this.panel); //PanelManager.getInstance().normalizePanel(this); 
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Mouli,

   Not knowing what the "pos" var has in it I could not say whats wrong with your code.

0 Kudos
MS2
by
New Contributor II

Robert,

"pos" variable is same as the one I mentioned in my question. check below.

var pos = {    
     width: '600px',    
     height: '500px'    
};
  1. this.setPosition(pos); 
  2. PanelManager.getInstance().normalizePanel(this.panel); //PanelManager.getInstance().normalizePanel(this);  
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Mouli,

   You need to re-look at the first link I provided the "pos" object need more than just width and height.

0 Kudos
MS2
by
New Contributor II

Thanks Robert. It helped a lot.

0 Kudos