Material-table: Error : getFieldValue is not a function when editing a child (Tree Data)

Created on 20 Jun 2019  路  8Comments  路  Source: mbrn/material-table

Describe the bug
When I click on the "edit" action button of a child row of a Tree Data table with parameter _editable: "onAdd"_ on one of the columns, I get the error :

Uncaught TypeError: _this2.props.getFieldValue is not a function

To Reproduce
Steps to reproduce the behavior:

  1. Create a Tree Data table with the parameter editable: "onAdd" on (at least) one column
  2. Add a row
  3. Add one or more children to this row
  4. Click on the Edit action button
  5. See the error

Expected behavior
Ability to edit the fields of the row.

Screenshots
image

Clicking on the edit action button of the row "groupe10" :

image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser : Chrome
  • Version 74.0.3729.169
bug wontfix

Most helpful comment

Same here when setting a column editable param to 'never'. Upon clicking the edit button my browser screen goes white and have to refresh to display the content again.

I was able to get around this for now (seems to work) by commenting out var readonlyValue = ...

and changing value: readonlyValue

to value: value:

        if (!columnDef.field || !allowEditing) {
          // var readonlyValue = _this2.props.getFieldValue(_this2.state.data, columnDef);

          return React.createElement(_this2.props.components.Cell, {
            icons: _this2.props.icons,
            columnDef: columnDef,
            value: value, //readonlyValue,
            key: columnDef.tableData.id,
            rowData: _this2.props.data
          });
        } else {

All 8 comments

Having the same error message pop up. Everything appears to work correctly, but the React error is concerning.

Same here when setting a column editable param to 'never'. Upon clicking the edit button my browser screen goes white and have to refresh to display the content again.

I was able to get around this for now (seems to work) by commenting out var readonlyValue = ...

and changing value: readonlyValue

to value: value:

        if (!columnDef.field || !allowEditing) {
          // var readonlyValue = _this2.props.getFieldValue(_this2.state.data, columnDef);

          return React.createElement(_this2.props.components.Cell, {
            icons: _this2.props.icons,
            columnDef: columnDef,
            value: value, //readonlyValue,
            key: columnDef.tableData.id,
            rowData: _this2.props.data
          });
        } else {

Getting the same error on clicking Add Icon for the first time after page loads, when using editComponent, later the error goes away on it's own.

Same here.

Warning: React does not recognize the getFieldValue prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase getfieldvalue instead. If you accidentally passed it from a parent component, remove it from the DOM element.

Also would be great to have column drag&drop logic configurable, so that it could be switched off if required (observing the same react-beautiful-dnd error here).

Is there any fix available right now??

Same issue here. Adding "editable: 'never'" to a column causes the issue when clicking on Edit.

any updates on this? 鈽癸笍

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

Was this page helpful?
0 / 5 - 0 ratings