Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Cancelling TreeGrid Edit

    I would like to cancel an edit that the user makes to a TreeGrid cell based on a somewhat complex set of rules.

    I've implemented and EditorExitHandler and call cancel on the EditorExitEvent object that is passed in, but the edit does not get canceled. The call to isCanceled returns true, but the cell gets the new value and the CellSavedHandler still gets called.

    The JavaDoc for the cancel method says "Returning false from this method will cancel the default behavior (for example saving the row) and leave the editor visible and focus in this edit cell."
    I'm not sure what that means because the return type is void and the method doesn't take any parameters.

    How can I dynamically cancel an edit to a grid cell?

    Thanks

    #2
    The Javadoc is incorrect and needs to be updated. You need to call EditorExitEvent.cancel() to cancel the event.

    Sanjiv
    Last edited by sjivan; 3 Jul 2009, 14:55.

    Comment


      #3
      Note that event cancellation cancels keyboard navigation, but not the change itself. To cancel that, call clearEditValue().

      Comment


        #4
        RE: Cancelling TreeGrid Edit

        Thanks, clearEditValue worked (after upgrading from ver 1.0 to 1.1).

        Comment

        Working...
        X