3 Replies Latest reply on Sep 26, 2008 9:26 AM by want-a-dw

    Datagrid scrolling problem

    want-a-dw
      I'm trying to create a contact search/selection component that works somewhat like a combobox (more like SuperComboBox http://blog.strikefish.com/blog/index.cfm/2008/3/21/Flex-Smart-Combo-aka-look-ahead-combo .

      See sample at http://www.eval.rmc.psu.edu/dgt/DataGridTest.html Source view is enabled.

      Basically, after the user types a few characters of the last name, a datagrid (separate component) is popped up and presents a list of matching contacts. The component includes view edit add buttons, too (which are not active in the included example).

      This all works great except for a couple of problems with the popped up datagrid. I've tried both the standard and advanced dg's and the both act the same.

      If the number of rows returned exceeds the area of the datagrid (12 rows in the example), the datagrid, as expected, displays a vertical scroll bar. The scrollbar/datagrid doesn't work properly at that point, though. Clicking the down arrow or in the scrollbar track or the down arrow DOES NOT scroll the data. Grabbing the slider bar and dragging it down DOES scroll the data down. However, when I do scroll down using the slider, clicking on a row does not fire the itemClick event, and the grid scrolls up to the first 12 lines and highlights a row in the first 12 rows. CLICK does get fired but always returns a row between 1 and 12.

      Now, ideally, the user is going to type 3 or 4 characters of the last name and zero right in on the contact they're looking for without the need for scrolling, but there are always the outliers like 'Smith' that return a large number hits (the example uses PA Legislators offices, so it's not quite representative of the end-use data set). Regardless, the datagrid object doesn't appear to work correctly when it's a component -- I'm not sure if it's a bona fide bug, or the whether it's that the grid is a component, contained in a canvas, or being popped up that's the problem. More likely, my flex newbie self just doesn't have some vital attribute set correctly, or I'm doing something else that's not correct.

      Any insights would be greatly appreciated.

      Thanks,
      want-a-dw

      Sample code included.
      Windows XP SP2
      Flex Builder 3.0.205647
      Same results with these browsers/player versions.
      Firefox 2.0.0.17, Flash Player 9.0.124.0 (and 9.0.115.0)
      IE 6.0.2900.2180, Flash Player 9.0.124.0 (and 9.0.115.0)
      Chrome 0.2.149.30, Flash Player 9.0.124.0