incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Kessler (JIRA)" <>
Subject [jira] [Updated] (FLEX-33190) GridEvent.GRID_DOUBLE_CLICK is dispatched even when two different cells are clicked
Date Mon, 10 Sep 2012 12:27:07 GMT


Mark Kessler updated FLEX-33190:


Here is a possible fix for it.  Added a new variable to track the last row clicked and does
a check for it in the doubleclick. This should also correct lack of single click events being
triggered.  Was unable to recompile the SDK with ant to test properly.

    private var lastClickRowIndex:int = -1;

    private function dispatchGridClickEvents(mouseEvent:MouseEvent, gridXY:Point, rowIndex:int,
        var dispatchGridClick:Boolean = (rowIndex == mouseDownRowIndex &&
                                         columnIndex == mouseDownColumnIndex);
        var newClickTime:Number = getTimer();
        // In the case that we dispatched a click last time, check if we
        // should dispatch a double click this time.
        // This isn't stricly adequate, since the mouse might have been on a different cell
        // the first click.  It's not clear that the extra checking would be worthwhile.
        if (doubleClickEnabled && dispatchGridClick && !isNaN(lastClickTime)
            (newClickTime - lastClickTime <= DOUBLE_CLICK_TIME) && rowIndex ==
            dispatchGridEvent(mouseEvent, GridEvent.GRID_DOUBLE_CLICK, gridXY, rowIndex, columnIndex);
            lastClickTime = NaN;
            lastClickRowIndex = -1;
        // Otherwise, just dispatch the click event.
        if (dispatchGridClick)
            dispatchGridEvent(mouseEvent, GridEvent.GRID_CLICK, gridXY, rowIndex, columnIndex);
            lastClickTime = newClickTime;
            lastClickRowIndex = rowIndex;

> GridEvent.GRID_DOUBLE_CLICK is dispatched even when two different cells are clicked
> -----------------------------------------------------------------------------------
>                 Key: FLEX-33190
>                 URL:
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Grid
>    Affects Versions: Apache Flex 4.8 (parity release)
>            Reporter: Shigeru Nakagaki
>         Attachments: DataGridTest.mxml,
> In dispatchGridClickEvents method of "s:Grid" class, GridEvent.GRID_DOUBLE_CLICK is dispatched.
But there is no check of whether the same cell was clicked.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message