2 Replies Latest reply on Oct 20, 2007 2:08 AM by bortot

    nested container scrollbar

      look at this simple component:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:VBox xmlns:mx=" http://www.adobe.com/2006/mxml" width="400" height="300" horizontalAlign="center">
      <mx:Label text="Title"/>
      <mx:Box id="gridBox" width="100%" height="100%">
      <mx:DataGrid id="grid" height="100%" width="100%">
      <mx:Button label="Button" click="grid.width = grid.width * 2"/>

      when I click the button, the grid grows larger than the component and a scrollbar appears at component level: that is, it scrolls the title, the grid and the button.
      I would like to force the scrollbar to appear inside gridBox, so that only the grid is affected when scrolling.
      How is it possible?

      Luca Bortot
        • 1. Re: nested container scrollbar
          ntsiii Level 3
          Set a fixed height on the dataGrid.

          If you want it to resize with the container, you might be able to calculate the height:
          <mx:DataGrid .. height="{this.height-25}"
          I think that will still count as a fixed height.

          Controlling scrollbars is tough.

          • 2. Re: nested container scrollbar
            bortot Level 1
            I did not explain myself clearly: I want to let the grid grow, and pan over it through its direct container scrollbars.
            Still, your hint was winning: I set the *container*'s width to a "fixed" (bound) value and it did it.