5 Replies Latest reply on Oct 10, 2012 7:26 AM by aciam70

    NavigatorContent problem


      Hello everyone,

      I'm using flex 4.5 and I have a problem with NavigatorContent.

      I have two NavigatorContents and on creation complete event I verified that the NavigatorContent not visible has the width property to zero.

      Only when it becomes visible width property is set correctly. Why does this happen?


      The NavigatorContent with width equal to zero has inside a data grid and its column widths are connected to container.  So I can not see the data grid correctly.

      Has anyone any suggestions to solve this problem?



        • 1. Re: NavigatorContent problem
          Abhishek Chaudhary

          You can bind datagrid width to navigator content's width.

          Are you trying to bind navigator content's width to dg column width?

          Please post code for further details.



          Abhishek Chaudhary
          InfoCepts | www.infocepts.com

          • 2. Re: NavigatorContent problem
            aciam70 Level 1

            Maybe I didn't explain well

            Here my code"


            <s:BorderContainer id="bc" width="50%" height="100%">

                <mx:ViewStack id="vsQ1" width="100%" height="96%">

                    <s:NavigatorContent id="ncQ1_1" width="100%" height="100%" >



                            <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />




                    <s:NavigatorContent id="ncQ1_2" width="100%" height="100%">

                        <components:CompDataGridQ1 id="compQ1" width="98%" height="98%"/>



                            <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />






                <s:HGroup width="100%" height="4%" >

                    <mx:ToggleButtonBar id="tbQ1"

                        toggleOnClick="true" itemClick="ItemClickHandler_tbQ1(event)" 

                        width="20%" height="100%" dataProvider="{vsQ1}"/>




                    <s:VerticalLayout verticalAlign="middle" horizontalAlign="center"/>





            In "compQ1" I have a DataGrid that I can't set column width at creationComplete event

            Here the compQ1



            <mx:DataGrid xmlns:fx="http://ns.adobe.com/mxml/2009"



                         width="100%" height="100%"





                    <!-- Place non-visual elements (e.g., services, value objects) here -->





                        import mx.collections.ArrayCollection;

                        import mx.events.FlexEvent;



                        private var _acData:ArrayCollection = new ArrayCollection();



                        public function InizializeColumnsWidth():void


                            c1.width = .55 * width;

                            c2.width = .45 * width;






                    <mx:DataGridColumn id="c1" headerText="A" dataField="A" textAlign="left" />

                    <mx:DataGridColumn id="c2" headerText="B" dataField="B" textAlign="right"/>







            • 3. Re: NavigatorContent problem
              Abhishek Chaudhary Level 1

              So, you are not getting column widths in proportion of 55:45?

              • 4. Re: NavigatorContent problem
                Abhishek Chaudhary Level 1

                Are you missing out to call InizializeColumnsWidth func on creation complete?

                • 5. Re: NavigatorContent problem
                  aciam70 Level 1

                  I didn't post the creation complete function but I call InizializeColumnsWidth on it.