0 Replies Latest reply on Nov 16, 2009 1:35 AM by jvjv75

    DataGrid: itemEditBeginning fires when it should not

    jvjv75

      hi all,

       

      I spent some time workarounding an issue with DataGrid with vertical scroll bar.

      when you click on the scroll bar, the itemEditBeginning (aka DataGridEvent.ITEM_EDIT_BEGINNING) event fires.

       

      If you want to deal wth this event in "standard" cases (well, if you want to deal with DataGridEvent.ITEM_FOCUS_OUT event too, since it will fire just after), the unexpected event makes your GUI behave very strangely

       

      The workaround I wrote is simply avoid event propagation when event's data is null.

       

      It can be something like (just plug this function on itemEditBeginning event, of course)

       

                  private function onItemEditBeginning(e : DataGridEvent) : void
                  {
                      var ir : Object = e.itemRenderer;
                      var d  : Object = (ir == null) ? null : ir.data;
         
                      if (d == null) {
                          e.preventDefault();
                      }                                                   
                  }

       

      This appears with either player 10.0.32.18 or player 9.0.124.0 (application compiled with Flex Builder 3)

       

      Is this behaviour ok (i.e. it's a feature ) or is it a bug ?

      if so, is it known ? fixed ? etc...

       

      thanks in advance

      --

      Joseph