question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception on editing or deleting with multiple row selection enabled

See original GitHub issue

Describe 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:

  1. Create a table with option “selection” set to true.
  2. Provide a edit and delete action (like in: https://material-table.com/#/docs/features/editable).
  3. Select any number of rows.
  4. Click either the edit or delete action button in the top right.
  5. 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:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
ouweiyacommented, Jul 19, 2019

Disappointed

4reactions
mbrncommented, Jun 1, 2019

I will try to find a solution to this case asap

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found