2 Replies Latest reply on Aug 31, 2011 2:22 PM by dhsflex01

    Flex Layout resize

    dhsflex01

      Hi,

       

      In our project we have a requirement component/container(for example I am putting Grid component inside Group Container) should resize based up on the browser size, also component should shrink dynamically(auto adjust width & height) when browser resizes.  I have tried width="100%" height="100%"  I get scrollbars, but that is not the requirement expected output is component/container should resize automatically when browser resizes.

       

      Is it possible in Flex ?

       

      Thanks,

      Kumar.

        • 1. Re: Flex Layout resize
          Claudiu Ursica Level 4

          Listen to the resize event on the stage and resize accordingly. If the component has a skin the resize code should go inside the skin, or event better define a resizer class and inside skin you will pass the host component to this class.

           

          C

          1 person found this helpful
          • 2. Re: Flex Layout resize
            dhsflex01 Level 1

            Thanks for your suggestion.

             

            I have already suggested this solution worked fine but my suggestion was not accepted since our application is huge application it is difficult to do the changes at the component level.We are looking at container/Layout level of changes.

             

            Also I have tried below:

             

            making width=100% height=100% works fine it streatches according to the browser height & width but the problem is other components making not working this solution for example if I have

             

            <s:Group x="45" y="25" width="100%">

             

                <mx:AdvancedDataGrid x="97" y="268" id="adg1" designViewDataType="tree" width="100%">
                    <mx:columns>
                        <mx:AdvancedDataGridColumn headerText="Column 1" dataField="col1"/>
                        <mx:AdvancedDataGridColumn headerText="Column 2" dataField="col2"/>
                        <mx:AdvancedDataGridColumn headerText="Column 3" dataField="col3"/>
                    </mx:columns>
                </mx:AdvancedDataGrid>

             

            <example:component1 id="id1"   width="100%"/>

             

            </s:Group>

             

             

            In the above code everything it works fine If i put <example:component1 inside the s:Group  it is not working fine. I have tried using 2 group container resize for the datagrid works fine. Looks like some issue with the component one some where in the code.

             

            Any ways Flex width=100% stretch works like champ.

             

            Thanks for your time.

             

            Kumar.