Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] EditingState onDeletedRowIdsChange does not pass row ID as parameter #1223

Closed
2 of 4 tasks
thehig opened this issue Jun 28, 2018 · 4 comments
Closed
2 of 4 tasks
Labels
bug Grid The DevExtreme Reactive Grid component

Comments

@thehig
Copy link

thehig commented Jun 28, 2018

  • I have searched this repository's issues and believe that this is not a duplicate.

I'm using ...

  • React Grid
  • React Chart
  • Vue Grid

Example

https://codesandbox.io/s/q8o40kn474

Current Behaviour

Clicking an 'edit' button passes the row ID as a parameter to the onEditingRowIdsChange event. Clicking a 'delete' button passes nothing to the onDeletedRowIdsChange event, and calls onCommitChanges

Expected Behaviour

Clicking a 'delete' button passes the row ID as a parameter to the onDeletedRowIdsChange, and does not immediately call onCommitChanges when in controlled mode


Temporary Workaround

 <EditingState
      editingRowIds={editingRowIds}
      onEditingRowIdsChange={onEditingRowIdsChange}
      deletedRowIds={deletedRowIds}
      onDeletedRowIdsChange={() => {
        /* No-Op since this doesn't work properly https://github.com/DevExpress/devextreme-reactive/issues/1223 */
      }}
      rowChanges={rowChanges}
      onRowChangesChange={onRowChangesChange}
      addedRows={addedRows}
      onAddedRowsChange={onAddedRowsChange}
      onCommitChanges={changes =>
        // Don't immediately commit deletes, send them to the expected code path
        changes && changes.deleted
          ? onDeletedRowIdsChange(changes.deleted)
          : onCommitChanges(changes)
      }
    />

and in the Confirmation Dialog event handlers

     onCancelDelete={() => {
        // Set the deleting row IDs to empty
        onDeletedRowIdsChange([]);
      }}
      onConfirmDelete={() => {
        // Submit the deletion along the original commit path
        onCommitChanges({ deleted: deletedRowIds });
      }}
@SergeyAlexeev SergeyAlexeev self-assigned this Jul 3, 2018
@SergeyAlexeev
Copy link
Contributor

Hi,

Thank you for pointing out to this issue. The deletedRowIds property contains row IDs prepared for deletion and is required for 'Batch deleting'. This feature isn't fully implemented for now and it was premature to include descriptions of such properties.

Currently, a click on the 'Delete' button immediately commits rows to be deleted. Please refer to this demo to see how to delete rows in controlled mode.

@YamaRoo
Copy link

YamaRoo commented Sep 17, 2018

@SergeyAlexeev Would this be why deletedRowIds and onDeletedRowIds are not part of the Typescript definition for EditingState?

@SergeyAlexeev
Copy link
Contributor

Yes, it is.

@dxrobot dxrobot added the Grid The DevExtreme Reactive Grid component label May 2, 2019
@lock
Copy link

lock bot commented Jun 15, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Grid The DevExtreme Reactive Grid component
Projects
None yet
Development

No branches or pull requests

4 participants