Select to view content in your preferred language

Resizing widget programmatically and the minimize/maximize effect

3839
2
Jump to solution
04-03-2013 04:55 AM
KennyWebster
Deactivated User
I have a custom made widget which has a few states and depending on the state the window resizes a bit to accomedate the content of the different states.  This all works fine.

My issue is when a user minimizes a widget and then reopens it.  The widget will always default back to it's orginal size regardless of state.

My first thought was to correct this in the widget open handler.  However - it seems the effect that the viewer uses to maximize/minimize a widget must get ahold of the default size before the open widget handler fires since I can see the widget resize to what I would like as the effect starts, then morphs back to default as the effect ends.

As a bandaid I've added a flag which I set in the widget minimized handler and then reset in the widget open handler so I know if the widget is opening or minimizing.  Then I added an effectEnd handler for the widgettemplate and if it's not being minimized I set the size appropriately.  What the user sees is the widget animates open to default size then snap back to the correct size for the current state.

I feel like there must be a way to get a hold of the size that the animation effect is using on minimize and reopen.  Something I'm missing here?

Oh and I've tried setting default sizes for each state by way of width.<statename> = xxx etc.  No go.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Kenny,

   Look in my eDraw widget for a code example as I am handling this exact situation.

http://www.arcgis.com/home/item.html?id=91a0014160fc4a9caadc2c7fd7089c1b

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
Kenny,

   Look in my eDraw widget for a code example as I am handling this exact situation.

http://www.arcgis.com/home/item.html?id=91a0014160fc4a9caadc2c7fd7089c1b
0 Kudos
KennyWebster
Deactivated User
Of course there's a second height and width property....  Makes perfect sense!

For those wondering, setting wTemplate.widgetHeight and widgetWidth to match your height and width will solve this problem.

Thank you Robert.
0 Kudos