reactable icon indicating copy to clipboard operation
reactable copied to clipboard

Edit table

Open omarbenites opened this issue 5 years ago • 20 comments

Hi @glin, congrats for the pkg , looks really good!.

I wonder if Is there any possibility to edit values in reactable?

Thanks in advance. Keep it up! Regards

omarbenites avatar Apr 23 '19 04:04 omarbenites

Hi, thanks for the suggestion! React Table doesn't support table editing out of the box, but it wouldn't be too hard to at least add a simple, inline editor like this: https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/archives/v6-examples/react-table-editable-content

Do you have any thoughts on how a more useful table editor would work? I had some questions after thinking about it for a bit:

  1. How would we begin editing a cell? Clicking on the cell, double-clicking the cell, clicking an "edit" button in the cell?
  2. Should we edit cells in the table itself or through a separate pop-up/modal?
  3. Should we edit individual cells or entire rows at a time?
  4. Would it be useful to allow adding/deleting rows?
  5. Would it be useful to customize inputs based on column type? e.g. dropdown for factors, calendar for dates, number-only text field for numerics
  6. Would it be useful to restrict certain columns, rows, or cells for editing?

glin avatar Apr 28 '19 16:04 glin

Thannks @glin. In fact, I would like all what you suggest. Below more detailed answers

  1. How would we begin editing a cell? Clicking on the cell, double-clicking the cell, clicking an "edit" button in the cell? Ans.: Double click would be the best way.

  2. Should we edit cells in the table itself or through a separate pop-up/modal? Ans. : Both options would be great. Maybe, have a function's argument editView with two options: table (by default to edit directly in the table) and modal to edit in a separate pop-up/modal.

  3. Should we edit individual cells or entire rows at a time? Yes, we should. Perhaps the first step would be by edit by cell and the move edit by column

  • Question (4) and (5) You read my mind, That would be very helpful for users
  1. Would it be useful to restrict certain columns, rows, or cells for editing? Yes, it would nice to give the possibility to edit in different ways. For example, have an argument editColumns with two values: All to edit all columns, and vector argument like c(col1, col2,..coln ) as where the users introduce the index of the columns that they want to edit. editRows, should be similar to editColumns. Have editCells argument, where users insert a list of (x,y) pair. Ex.: editCells=list( c(1,2), c(4,5), c(90,88) )

I leave these comments under your consideration.

omarbenites avatar May 02 '19 08:05 omarbenites

I like this idea! It would be nice if the edit can be reflected to server-side on Shiny.

atusy avatar Aug 16 '19 00:08 atusy

is there any development on this?

EnzoHG avatar Apr 24 '20 08:04 EnzoHG

Hi, thanks for the suggestion! React Table doesn't support table editing out of the box, but it wouldn't be too hard to at least add a simple, inline editor like this: https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/archives/v6-examples/react-table-editable-content

Do you have any thoughts on how a more useful table editor would work? I had some questions after thinking about it for a bit:

  1. How would we begin editing a cell? Clicking on the cell, double-clicking the cell, clicking an "edit" button in the cell?
  2. Should we edit cells in the table itself or through a separate pop-up/modal?
  3. Should we edit individual cells or entire rows at a time?
  4. Would it be useful to allow adding/deleting rows?
  5. Would it be useful to customize inputs based on column type? e.g. dropdown for factors, calendar for dates, number-only text field for numerics
  6. Would it be useful to restrict certain columns, rows, or cells for editing?

Hi, is this feature is still pending? please let us know. thank you. Interested in using something like a dropdown selection for factors to edit a table cell.

amanthapar avatar Sep 10 '20 18:09 amanthapar

I can't believe I just found this package. Wonderful! I'm curious if any movement has been made on making anything editable?

jordanwebb10 avatar May 11 '21 15:05 jordanwebb10

+1

Steviey avatar Oct 02 '21 15:10 Steviey

This would be a very useful feature

samssann avatar Oct 19 '21 09:10 samssann

+1

In my opinion, this is a best package for insert tables in Shiny apps, with the to edit table resource the package will be perfect

henrique1008 avatar Apr 06 '22 17:04 henrique1008

+1 for the editing!

mfahlberg824 avatar Apr 20 '22 02:04 mfahlberg824

editing would really make reactable complete

gaspare-mattarella avatar Sep 08 '22 12:09 gaspare-mattarella

for shiny users, an alternative is using the select option already in reactable

You can click and selector in row, and create a logic to open a modal in shiny app with inputs that edit the fields the row, and when you click to close the modal and save, this inputs change the dataframe into shiny, and edit the data.

If all this is a reactive logic, the table in user interface will be edited

I use this and work very well

henrique1008 avatar Sep 08 '22 12:09 henrique1008

for shiny users, an alternative is using the select option already in reactable

You can click and selector in row, and create a logic to open a modal in shiny app with inputs that edit the fields the row, and when you click to close the modal and save, this inputs change the dataframe into shiny, and edit the data.

If all this is a reactive logic, the table in user interface will be edited

I use this and work very well

Would be useful if you share a reproducible example for to have an idea of how to implement it (I am not a react developer)

omarbenites avatar Sep 12 '22 00:09 omarbenites

@omarbenites This gist may be a good reproducible example to get you started on what @henrique1008 suggested.

Meanwhile, I am eagerly waiting for an official editable reactable implementation as well 🤞🏼

DeepanshKhurana avatar Mar 21 '23 06:03 DeepanshKhurana

Looking forward to using this new functionality. I hope it can be implemented soon.

camult avatar Mar 31 '23 19:03 camult

Hi @glin, what a powerful package! I'm just wondering if there is any update on the feature of editing. Thanks!

wangsx08 avatar Jun 28 '23 16:06 wangsx08

It would be cool if reactable were editable. In fact, in the process of developing a shiny app with reactable, we have more and more requests for table edits, additions, deleations, validation and so on.

kaipingyang avatar Oct 18 '23 07:10 kaipingyang

Hi, thanks for the suggestion! React Table doesn't support table editing out of the box, but it wouldn't be too hard to at least add a simple, inline editor like this: https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/archives/v6-examples/react-table-editable-content

Unfortunately this link seems to have died 🙁 Is it possible to share the code in a gist please?

wurli avatar Apr 15 '24 14:04 wurli

I got a ping from this thread with your message @wurli so I figured I'll share this.

At Appsilon, we are now using reactable.extras for most of the editing use-cases. The text_extra() definition works really well.

DeepanshKhurana avatar Apr 16 '24 09:04 DeepanshKhurana

@DeepanshKhurana Thanks for this - had a quick test and this looks like it'll be perfect for what I need! For anyone else who takes a look, the easiest way to get started is to run the first example from the custom inputs tutorial.

wurli avatar Apr 16 '24 10:04 wurli