material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Add ability to inline edit on rows without having to click edit button

Open jakeleventhal opened this issue 6 years ago • 23 comments

Is your feature request related to a problem? Please describe. It is difficult and annoying sometimes to click the edit button on a row to edit its contents. Many users on our software have complained about this and would like to just be able to click to edit a row

Describe the solution you'd like Cells should be clickable - bringing up the edit component This is a good example of what we are looking for functionality-wise. It would of course have to fit the Material theme

jakeleventhal avatar Dec 25 '19 19:12 jakeleventhal

Hello, Is there any update on this feature ? Do we have insight on this way to implement the edit on rows w/o edit button. I'm trying to customize it but didn't get any way. Please confirm.

tharun968 avatar Jan 09 '20 06:01 tharun968

Same issue here, planning to customize the package with required functionality, will update the repo soon.

itsmeganesh-cse-iiit avatar Feb 11 '20 09:02 itsmeganesh-cse-iiit

Something looking

dharmesh-r-patel avatar Feb 25 '20 10:02 dharmesh-r-patel

up

Dobata7 avatar Mar 17 '20 15:03 Dobata7

I would love this feature!

MichaelJC91 avatar Mar 31 '20 07:03 MichaelJC91

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.

stale[bot] avatar Jul 05 '20 18:07 stale[bot]

not stale!

jakeleventhal avatar Jul 05 '20 18:07 jakeleventhal

@mbrn we would also love to have this feature. Currently, edit is available only on row level. So, all selection options of a selector field are not visible. If this is editable on cell level, then the selector options changing and visibility would become drastically enhanced.

iamsaurabhgupt avatar Jul 14 '20 18:07 iamsaurabhgupt

I started to work on :)

mbrn avatar Jul 22 '20 18:07 mbrn

Awesome @mbrn . Would wait for this release. You can have a look at Datatable Editor for building a similar functionality on React. If this gets built, then you would have taken it to another level altogether. image

iamsaurabhgupt avatar Jul 22 '20 19:07 iamsaurabhgupt

Hi,

You can use the feature with the version 1.67.1

To see an example: https://material-table.com/#/docs/features/editable

Note: We can develop it more. This is first release about cell editing.

mbrn avatar Jul 26 '20 15:07 mbrn

@mbrn It it possible to remove that underline? It's spoiling the aesthetics. Rest looks great. Thanks a lot for the amazing work. image

iamsaurabhgupt avatar Jul 27 '20 05:07 iamsaurabhgupt

@iamsaurabhgupt

Of course. I can do it configurable.

Also i will add a cellEditable.type (select, all) select: Current style of editing. Users should select cell to edit. all: All cells would be editable at the same time with a flag.

mbrn avatar Jul 27 '20 05:07 mbrn

@mbrn Yes, that seems wonderful. Also, we tried to change the styling of selector like a chip. image But, the table was not accepting it. Is that something that's currently possible or it needs a fresh issue to be created?

iamsaurabhgupt avatar Jul 27 '20 05:07 iamsaurabhgupt

@iamsaurabhgupt

You can override editComponent.

mbrn avatar Jul 27 '20 05:07 mbrn

@mbrn is there a documentation how to do it? May be I am missing something.

iamsaurabhgupt avatar Jul 27 '20 05:07 iamsaurabhgupt

@iamsaurabhgupt

https://material-table.com/#/docs/features/editable

does 3rd example solve your needs?

mbrn avatar Jul 27 '20 05:07 mbrn

Hi @mbrn awesome work on cell edit feature. However, editComponent does not override default input with the cell editing feature. I used row editing before this release and editComponent was working fine but since I installed the latest version (1.68.0) and switched to cell editing it does not work anymore. Row editing still works fine with the latest release.

          { 
            title: 'Tags',
            field: 'tags',
            editComponent: (props) => {
              return (
                <ChipInput
                    value={props.value}
                    newChipKeyCodes={[188]}
                    newChipKeys={[',']}
                    placeholder="Enter comma separated values"
                    onAdd={tag => props.onChange([...props.value, tag])}
                    onDelete={(tag, index) => {
                      props.value.splice(index,1);
                      props.onChange([...props.value]);
                    }}
                />
              );
            },
            render: (rowData) => {
              return (
                <div>
                  {rowData.tags.map((tag) => {
                    return (
                      <Chip
                        key={tag}
                        label={tag}
                        className={classes.chip}
                      />
                    )
                  })}
                </div>
              );
            }
          }

enisit avatar Aug 04 '20 10:08 enisit

@mbrn Row editing allows disabling editing of selective fields. But, cell edit is not allowing to disable editing on some fields. We are not able to utilise this feature due to this gap. image

iamsaurabhgupt avatar Aug 18 '20 07:08 iamsaurabhgupt

@mbrn is it possible to combine editComponent with cellEditable or does cellEditable override the editComponent? My use case is trying to create a custom dropdown whose values are fetched from an api and are dynamic depending on the the type of data in the row. So a row with type A will get type A options vs row type B will get type B options. The editComponent would allow me to abstract its logic out, take a prop and fetch the specific dropdown values associated with that prop. I haven't been able to combine editComponent and cellEditable and wasn't sure if this was even possible at this time or if i'm just not doing it correctly.

pinkMoneyKing avatar Oct 01 '20 15:10 pinkMoneyKing