Select to view content in your preferred language

Attribute Table Widget - Change Size

1330
6
Jump to solution
01-27-2013 08:23 PM
ShaunWeston
Frequent Contributor
I'm trying to change the size of this widget, but doesn't seem to be working from the config using this:

<widgetcontainer paneltype="bottom" initialstate="open" height="250">
<widget label="Attribute Table" config="widgets/AttributeTable/AttributeTableWidget.xml" url="widgets/AttributeTable/AttributeTableWidget.swf"/>

</widgetcontainer>

If I change the height to 100, it doesn't change the size of the widget?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ShaunWeston
Frequent Contributor
Thanks for pointing me in the right direction.

I am using a panel so I had to change the panel height value, which I found in WidgetManager.mxml

It's set to 250.

                        if (ctn.panelType == "bottom")                         {                             bottomContainerVisible = ctn.initialState == "collapsed" ? false : true;                               bcSize = ctn.size ? ctn.size : 250;                             bottomContainer = getBottomContainer(bcSize, bottomContainerVisible);                             bottomContainer.addEventListener(ResizeEvent.RESIZE, handleBottomContainerResize);                             bottomContainer.gap = 2;                             bcOrder = containerCount;                         }

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Shaun,

   The AttributeWidget is hard coded for a height of 300 if you are not using it in a panel.

            private function basewidget_initializeHandler():void
            {
                if (isPartOfPanel) // if widget is part of "left", "right" or "bottom" panel
                {
                    this.percentWidth = this.percentHeight = 100;
                    wTemplate.percentWidth = wTemplate.percentHeight = 100;
                }
                else
                {
                    wTemplate.width = map.width - map.width / 100 - Number(this.left);
                    wTemplate.minWidth = 800;
                    wTemplate.height = wTemplate.minHeight = 300;
                }
            }


Also changing a individual widgets size would involve adding a height and width to the actual widget tag:

<widgetcontainer paneltype="bottom" initialstate="open" height="250">
    <widget label="Attribute Table" height="400" config="widgets/AttributeTable/AttributeTableWidget.xml" url="widgets/AttributeTable/AttributeTableWidget.swf"/>
</widgetcontainer>
0 Kudos
ShaunWeston
Frequent Contributor
Thanks for pointing me in the right direction.

I am using a panel so I had to change the panel height value, which I found in WidgetManager.mxml

It's set to 250.

                        if (ctn.panelType == "bottom")                         {                             bottomContainerVisible = ctn.initialState == "collapsed" ? false : true;                               bcSize = ctn.size ? ctn.size : 250;                             bottomContainer = getBottomContainer(bcSize, bottomContainerVisible);                             bottomContainer.addEventListener(ResizeEvent.RESIZE, handleBottomContainerResize);                             bottomContainer.gap = 2;                             bcOrder = containerCount;                         }
0 Kudos
AnthonyGiles
Honored Contributor
Instead of using height use size:

<widgetcontainer paneltype="bottom" initialstate="open" size="250">

This works without the need to change the source code.

Regards

Anthony
0 Kudos
DavidBoiano
Deactivated User
Instead of using height use size:

<widgetcontainer paneltype="bottom" initialstate="open" size="250">

This works without the need to change the source code.

Regards

Anthony



Hi Anthony,

I just wanted to comment since there was no confirmation by checkmark that your response was also correct.  I was looking to change the size of my attribute table and stumbled upon this thread--it seems to me your way is the easiest solution.  I was able to change the size of my attribute table panel by using the "size" property instead of "height".

Thanks again!

David
0 Kudos
xanderm
Regular Contributor
Is similar to changing the height of the actual widget inside of a left panel? This is what I am trying to do... I can't seem to gte the adjustment made though the mxml:

private function basewidget_initializeHandler():void
            {
                if (isPartOfPanel) // if widget is part of "left", "right" or "bottom" panel
                {
                    this.percentWidth = this.percentHeight = 100;
                    wTemplate.percentWidth = wTemplate.percentHeight = 150;
                }
                else
                {
                    wTemplate.width = 290;
                    wTemplate.height = 240;
                    wTemplate.minWidth = 210
                    wTemplate.minHeight = 160;
                }
            }
0 Kudos
DavidBoiano
Deactivated User
Xander,

I would guess it is not working here:
wTemplate.percentWidth = wTemplate.percentHeight = 150;


I don't think you can set a width/height as a percent value over 100. Hope this helps.


David
0 Kudos