Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

DataGrid should always fire editor close event #451

Closed
Flaurite opened this issue May 4, 2021 · 0 comments
Closed

DataGrid should always fire editor close event #451

Flaurite opened this issue May 4, 2021 · 0 comments
Assignees
Labels
breaking changes Fix brings breaking changes in code or behavior
Milestone

Comments

@Flaurite
Copy link
Contributor

Flaurite commented May 4, 2021

Description

Current behavior splits OK and CANCEL button actions on the following events:

  • OK: PreCommit, PostCommit (close event is not fired)
  • CANCEL: EditorClose

But in fact, PostCommit and EditorClose are not equivalent events:

  • when PostCommit is fired the Editor still opened;
  • when EditorClose is fired the Editor has already closed.

Sometimes it needs to have a hook when the entity is committed and the editor is closed.


Breaking changes

Inline editor always fires EditorClose event. To check with which action editor is closed use isCancelled() method.
For instance:

dataGrid.addEditorCloseListener(closeEvent -> {
    if (closeEvent.isCancelled()) {
        // closed by Cancel button
    } else {
        // closed by OK button
    }
});

For QA

Check that CloseEvent is fired for OK and Cancel button

@glebfox glebfox added this to the 1.1.0 milestone Jul 6, 2021
@Flaurite Flaurite assigned Flaurite and unassigned glebfox Aug 26, 2021
Flaurite added a commit to jmix-projects/jmix-cuba that referenced this issue Sep 1, 2021
@knstvk knstvk added the breaking changes Fix brings breaking changes in code or behavior label Sep 1, 2021
@lovtsovaik lovtsovaik assigned imorenov94 and unassigned lovtsovaik Sep 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking changes Fix brings breaking changes in code or behavior
Projects
None yet
Development

No branches or pull requests

5 participants