react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

Custom Dropdown editor not updating row

Open andrewjmac opened this issue 4 years ago • 2 comments

I've copied the example I could find to create a new drop down editor, having needed to remove the use of react-data-grid-addons

Below is an example of the column I am trying to create a dropdown on:

{ key: 'Type', name: 'Type', editable: true, hidden: false, editor: (p) => ( <select autoFocus value={p.row.Type} onChange={(e) => p.onRowChange({ ...p.row, Type: e.target.value }, true)}> {types.map((type) => ( ))} ), width: 250, formatter(props) { return <>{props.row.type}</>; }, editorOptions: { editOnClick: true, }, },

Expect for the value to update in the row, but it isn't updating and still returning blank.

  • react-data-grid version: 7.0.0-beta.7
  • react/react-dom version: 16.14.0

Any help greatly received!

andrewjmac avatar Oct 26 '21 19:10 andrewjmac

The documentation around the custom editors is not good. The only custom editor I could see is a percent completion bar which too is rendered on body tag instead of inside data grid cell.

What needs to be done to add an auto-complete dropdown editor which renders within the cell?

Right now it does render within the cell but the list remains hidden behind the cell, setting the position as absolute, adding z-index etc doesn't help either. Please provide some more examples of custom editors with v7 and the editors should render within the cells.

Thanks

khamani-fewcents avatar Dec 31 '21 07:12 khamani-fewcents

Can you create a reproducible codesandbox example?

amanmahajan7 avatar Jan 11 '22 18:01 amanmahajan7