Announcement

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

    How to cancel a ListGrid Insert.

    I have a Window that contains a databound ListGrid and an "Add New" button. When the button is clicked its onClick handler executes grid.starteditingnew(); and then disables the button.

    If the user closes the Window that contains the ListGrid it executes a method on the grid to re-enable the button, and I want to cancel the new record edit in progress.

    grid.cancelEditing() does not appear to do this however I have noticed that pressing the escape key does cancel an insert that is in progress.

    I assume that I need to fire an event to send an ESC key press event to the grid? Is that the way this is usually accomplished?

    If there is a better way please let me know, and if this is the right way to do it is there an existing ESC event already made or is it necessary to send a keypress event and pass the ESC key in it.

    Thanks

    #2
    I have the same question. What is the correct programmatic way to trigger the same behavior as the ESC key?

    Comment


      #3
      grid.cancelEditing is the correct API (and from a quick test, appears to be working exactly as expected).

      Can you verify that this isn't something like modalEditing being set to true, and causing a save to occur before the click handler for the button has a chance to cancel the edit?

      If this does look like a real bug, please show us a test case that demonstrates the issue so we can figure out what's going on.

      Comment

      Working...
      X