Select to view content in your preferred language

Panel default size

8914
12
Jump to solution
04-21-2015 01:41 AM
eduAED
by
Deactivated User

How can I configure the default size of a Panel?

I want to start a widget within a small panel.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
eduAED
by
Deactivated User

Thanks Previn!

I tryed what you said but it is not working for me...

What works for me was:

var pm = PanelManager.getPanelById("__id__Panel");

pm.resize({w:100});

Thanks!!

View solution in original post

12 Replies
StanMcShinsky
Frequent Contributor

edu AED ,

To change the default panel size you just need to adjust the values in the main config.json file. In there you will see values for height and width. This will allow you to adjust the size of the panel individually.

-Stan

0 Kudos
eduAED
by
Deactivated User

I would like to configure it on the widget itself by default. I tried to configure it on the manifest.json file, but it is not working.

Is there any other way to do it?

Thanks!

0 Kudos
StanMcShinsky
Frequent Contributor

I was referencing the main config.json file in server\apps\##\config.json not in the widget folder.

for example:

        "position": {
          "left": 55,
          "top": 45,
          "width": 400, //change this value
          "height": 410 //change this value
        },

-Stan

eduAED
by
Deactivated User

Yes, I know. But then it must be configured for each application.

My question is if it can be configured in the widget itself by default.

Thanks.

0 Kudos
StanMcShinsky
Frequent Contributor

edu AED ,

If you want to set it as the default for all new apps created then you would need to set it in the stemapp layout theme. For example for the foldable theme you need to edit the config here: arcgis-web-appbuilder-1.1\client\stemapp\themes\FoldableTheme\layouts\default\config.json This will make that widget spot that size no matter what widget you load into it.

For example, if you change the height to 800 and width to 600 of the widget space in that file and you reload your theme into your web app then every time you add a widget in that space (no matter the widget) you will get the panel to be that size. Here you are starting to create a custom theme.

If you want to adjust the width of the side panel then you would need to go into \arcgis-web-appbuilder-1.1\client\stemapp\themes\FoldableTheme\panels\FoldablePanel\Panel.js and modify this chunck of code and change the value from 360 to whatever you want.

    function getPanelWidth() {
      var layoutBox = html.getMarginBox(jimuConfig.layoutId);
      if (layoutBox.w <= criticality) {
        return '100%';
      } else {
        return 360;
      }
    }

-Stan

PrevinWong1
Esri Contributor

If you mean that you want to resize the widget panel during start up so that you are using the default theme, but want different size widgets, then I think you need to go through PanelManager.

require(["jimu/PanelManager","dojo/dom-style"], function(PanelManager, domStyle) {

var pm = PanelManager.getPanelById("__id__Panel");

domStyle.set(pm,"width",100);

}); something like that.

Very vague documentation.

PanelManager class—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers

StanMcShinsky
Frequent Contributor

Previn Wong ,

I have not tried that but it might be interesting to look into.

-Stan

0 Kudos
eduAED
by
Deactivated User

Thanks Previn!

I tryed what you said but it is not working for me...

What works for me was:

var pm = PanelManager.getPanelById("__id__Panel");

pm.resize({w:100});

Thanks!!

denverweston
Deactivated User

Can a resize be done on the current open panel?

0 Kudos