0 Replies Latest reply on Aug 11, 2006 7:37 PM by terracotta2323

    Datagrid scrolls when using cellPress listener

      I'm using a Datagrid component to display the contents of 2 columns of a mysql database table. I've included a cellPress listener that moves the pressed cell up to the top of the datagrid.

      The trouble is that once a cell is clicked and the mouse pointer is moved outside the datagrid, the contents of the datagrid scrolls and doesn't stop scrolling until the mouse pointer is moved back into the datagrid.

      Is there a way to prevent the scrolling?

      Here's the listener code (it's the only listener in the program):

      var dgClickListener:Object = new Object();
      dgClickListener.cellPress = function(evt_obj:Object) {
      var cell_str:String = "("+evt_obj.columnIndex+", "+evt_obj.itemIndex+")";
      // set row_num to top of grid position
      row_num = guest_dg.vPosition;
      guest_dg.addEventListener("cellPress", dgClickListener);

      The datagrid is created at runtime and all the code for the datagrid and listener occur on frame 5.