5 Replies Latest reply on Jun 28, 2006 9:48 AM by ntsiii

    Newbie layout help.

    Level 7
      I have an object (coming from a ColdFusion CFC) that contains an array
      of objects that can be 28, 35 or 42 elements long. I would like to
      display this in a grid 7 columns wide and 4, 5 or 6 rows as appropriate.
      Each of these objects will contain a record set or another array of
      objects (I have not decided yet) that I will then want to pass to a
      tilelist inside each grid cell.

      I can not see how to even start this kind of display. Any help would be
      most appreciated.
        • 1. Re: Newbie layout help.
          ntsiii Level 3
          Ian, this sounds exactly like a thread we worked on before. What is new or changed?

          Tracy
          • 2. Re: Newbie layout help.
            Level 7
            Nothing new, except I have time to play again. But I don't want the top
            level to be a tilelist.

            I've actually got some of it working now with a test array. Now I need
            to figure out how to use the array of objects I got from my remoteObject
            and use the dayFormat.mxml for the display rendering inside the GridItem
            cells.

            <mx:Grid>
            <mx:Repeater id="weekRows" dataProvider="{weeksAry}">
            <mx:GridRow>
            <mx:Repeater
            id="dayCells"
            dataProvider="{testStuff}"
            startingIndex="{weekRows.currentItem}"
            count="7">
            <mx:GridItem>
            <mx:Label text="{dayCells.currentItem}" />
            </mx:GridItem>
            </mx:Repeater>
            </mx:GridRow>
            </mx:Repeater>
            </mx:Grid>


            ntsiii wrote:
            > Ian, this sounds exactly like a thread we worked on before. What is new or changed?
            >
            > Tracy
            • 3. Re: Newbie layout help.
              ntsiii Level 3
              Well, GridItem is a container, and you should be able to put your custom component in it just fine.
              • 4. Re: Newbie layout help.
                Level 7
                Ok, I have a custom control created to handle the formating inside each
                of my gridItem. I want to pass the day object that is the current item
                of the Repeater into this custom control. How do I define the variable
                in side my custom control to accept on object of type "Day" defined in a
                Day.as file?

                That is what the repeater currentItem will pass in if it is looping over
                an array of Day object correct?

                <mx:Repeater
                id="dayCells"
                dataProvider="{testStuff}"
                startingIndex="{weekRows.currentItem}"
                count="7">

                <mx:GridItem width="14%">
                <ns1:dayFormat2 dayData="{dayCells.currentItem}" />
                </mx:GridItem>
                </mx:Repeater>

                Ian Skinner wrote:
                > <mx:Grid>
                > <mx:Repeater id="weekRows" dataProvider="{weeksAry}">
                > <mx:GridRow>
                > <mx:Repeater
                > id="dayCells"
                > dataProvider="{testStuff}"
                > startingIndex="{weekRows.currentItem}"
                > count="7">
                > <mx:GridItem>
                > <mx:Label text="{dayCells.currentItem}" />
                > </mx:GridItem>
                > </mx:Repeater>
                > </mx:GridRow>
                > </mx:Repeater>
                > </mx:Grid>
                • 5. Re: Newbie layout help.
                  ntsiii Level 3
                  In dayFormat2, declare a public vatiable, dayData typed as whatever the dayCells dataProvider items actually are. (Strong tying ensures reliable binding) Put the [Bindable] metatag above the declaration.

                  Now, As you have already in your repeater, the currentItem will get passed into the conponent.

                  Tracy