Exception on editing or deleting with multiple row selection enabled
See original GitHub issueDescribe the bug Cannot edit or delete any items when selection is enabled.
This is because an array is passed into this function but the function expect a single row object:
function changeRowEditing(rowData, mode) {
if (rowData) {
rowData.tableData.editing = mode;
if (this.lastEditingRow && this.lastEditingRow != rowData) {
this.lastEditingRow.tableData.editing = undefined;
}
if (mode) {
this.lastEditingRow = rowData;
} else {
this.lastEditingRow = undefined;
}
} else if (this.lastEditingRow) {
this.lastEditingRow.tableData.editing = undefined;
this.lastEditingRow = undefined;
}
To Reproduce Steps to reproduce the behavior:
- Create a table with option “selection” set to true.
- Provide a edit and delete action (like in: https://material-table.com/#/docs/features/editable).
- Select any number of rows.
- Click either the edit or delete action button in the top right.
- See exception below.
Expected behavior Should be able to edit or delete the row(s).
Callstack
Uncaught TypeError: Cannot set property 'editing' of undefined
at DataManager.changeRowEditing (data-manager.js:400)
at Object.onClick (material-table.js:472)
at handleOnClick (m-table-action.js:60)
at onClick (m-table-action.js:69)
at HTMLUnknownElement.callCallback (react-dom.development.js:149)
at Object.invokeGuardedCallbackDev (react-dom.development.js:199)
at invokeGuardedCallback (react-dom.development.js:256)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:270)
at executeDispatch (react-dom.development.js:561)
at executeDispatchesInOrder (react-dom.development.js:583)
at executeDispatchesAndRelease (react-dom.development.js:680)
at executeDispatchesAndReleaseTopLevel (react-dom.development.js:688)
at forEachAccumulated (react-dom.development.js:662)
at runEventsInBatch (react-dom.development.js:816)
at runExtractedEventsInBatch (react-dom.development.js:824)
at handleTopLevel (react-dom.development.js:4826)
at batchedUpdates$1 (react-dom.development.js:20439)
at batchedUpdates (react-dom.development.js:2151)
at dispatchEvent (react-dom.development.js:4905)
at react-dom.development.js:20490
at Object.unstable_runWithPriority (scheduler.development.js:255)
at interactiveUpdates$1 (react-dom.development.js:20489)
at interactiveUpdates (react-dom.development.js:2170)
at dispatchInteractiveEvent (react-dom.development.js:4882)
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Create, edit or delete a relationship
On the Database Tools tab, in the Relationships group, click Relationships. On the Design tab, in the Relationships group, click All Relationships.
Read more >Index out of range Exception on deleting a row
I can delete only last row without errors. If I commment m_dictionaryTableGrid. DataBind(); in rowDeleting event, everything works fine.
Read more >Making Edits During Multiple-Row Editing
◦ You can perform content delete operations. • Moving. ◦ You can perform move operations. However, some exceptions do exist:.
Read more >4. Inserting, Updating, Deleting - SQL Cookbook [Book]
Oracle's multi-table insert uses WHEN-THEN-ELSE clauses to evaluate the rows from the nested SELECT and insert them accordingly. In this recipe's example, ...
Read more >Rule exceptions and value lists
Find rules using the same exceptionedit ... To find out if an exception is used by other rules, select the Rule exceptions or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Disappointed
I will try to find a solution to this case asap