1 Reply Latest reply on Apr 22, 2011 11:08 AM by Jason Szeto

    How to align a viewport of a Scroller?

    ycagwyw

      Hello,

       

      I have a spark Scroller which hosts a DataGroup with a vertical virtual layout. I populate the DataGroup with some item renderers (say, checkboxes). By default, checkboxes are aligned to the left and the scrollbars and everything works just fine.

       

      The requirement that I have is to allow the users to center- or right-align the checkboxes. I'm able to do so, but the checkboxes align within the content width taken up by all checkboxes (which is the width of the widest checkbox). So, if the widest checkbox is narrower than the Scroller, I get a "blank" space to the right of the checkboxes.

       

      Is there any way to "move" the entire viewport, if it's narrower than the Scroller, so that it aligns to the center or right of the entire Scroller? I tried a hundred different things (with viewport, content, scroller, etc.) but nothing seems to work. I haven't been able to find anything of relevance on the Web, but I might just be missing something simple...

       

      Any help would be greatly appreciated.

      Thanks!