AllenFang / react-bootstrap-table

A Bootstrap table built with React.js
https://allenfang.github.io/react-bootstrap-table/
MIT License
2.24k stars 782 forks source link

Use insert modal as edit modal #1368

Open silver17 opened 7 years ago

silver17 commented 7 years ago

Is there a way, to use the add new row modal as editing modal? If I add an edit button to every row, then clicking on the edit button should open the insert modal with values already filled.

AllenFang commented 7 years ago

For now, this is a good feature but minor to me. You can have a custom modal to popup when you click your button and update your data by setState or call handleEditCell which is a exposed API but BootstrapTable.

Currently, I've no much time to create feature, so only focus on critical bugs, so PR is welcome, thanks

Bcheynel commented 7 years ago

«You can have a custom modal to popup when you click your button». How can I do that ? Thanks

prajapati-parth commented 7 years ago

@Bcheynel You can pass onRowClick within options as row selection hooks and then write your custom code for the modal to pop up. Please refer this page, section "Selection Hooks"

Bcheynel commented 7 years ago

Thanks prajapati-parth but my problem is on the custom code for the modal to pop up...

AllenFang commented 7 years ago

@Bcheynel like I mention, it's impossible to use insert modal to edit row. So my workaround is you need to implement a modal by yourself then call handleEditCell or update state when saving

PTOSH123 commented 6 years ago

Hi @AllenFang,

First of all , It gave a lot of peace and time saving approach for new comers to use existing library!

I am trying to implement a functionality in which table has a button and after clicking it, It should open modal ,based on data provided on modal it should get updated in table, how can i acheive that with the boostrap lib.?

tarim commented 6 years ago

Hi @AllenFang,

I have the same issue. I did update row with custom modal. And, it works fine. It updated the redux store, but it did not refresh the table until you click the table one more time.

Any idea, please?

Thank you

Adrianns commented 6 years ago

@tarim , @AllenFang I need to update a row in my custom modal. But I can't find the event to open modal from an icon in my row. Can you help me?

capture