rubanraj54 / vue-bootstrap4-table

Advanced table based on Vue 2 and Bootstrap 4 ⚡️
MIT License
220 stars 58 forks source link

Requesting a way to add an item #28

Open tettoffensive opened 5 years ago

tettoffensive commented 5 years ago

Hey, this is really useful, as I was otherwise going to build something like this from scratch.

I'm using it to make a CMS that interacts with a Firebase backend. I'd really like to be able to:

  1. Have a row where I can add an item directly inline.
  2. Be able to edit rows and click a button to update.
rubanraj54 commented 5 years ago

Hi @tettoffensive

Thanks for the suggestion.

I've been thinking a similar feature like this, but till 3rd week of April, I will be busy with my thesis work. So can't start implementing a big feature like this before that. However, we can talk here about the idea and how the workflow will look like.

This is what I thought of,

  1. Have a separate actions column to edit or delete a specified row.
  2. If user clicks the edit button, a modal will pop up with necessary prefilled form. Now user can interact with the form to update the values. Once user clicks save button, table will emit an event with the updated data. So the user can now decide to store the data in the server or not and returns a new updated set of data to table again.
  3. For adding a new row, we can follow the step 2 again but this time without prefilled values.

To make this work, I guess we should ask a schema from the user for the row. What I mean is, we can have a schema to represent the row model. So, based on this schema I can render the form and prefil the values.

What do you think? If you've any better suggestions we can talk here.

Cheers, Ruby.

tettoffensive commented 5 years ago

@rubanraj54 Your way would work. I had in mind something slightly different than a pop up modal. I was thinking more inline. Like the first or last row would have input fields that you could type into and click a button that says add or something.

I'm not sure which is better. Though I do tend to avoid modal pop ups. And I think there would need to be a good way to prevent people from creating duplicate entries based on uniqueId

rubanraj54 commented 5 years ago

This is also a nice suggestion, I will look into it.

sdrig commented 5 years ago

Inline edit or add actions would be very useful. Popup also can be good fit but there would be more complexity like form layout design would take long time more than inline option.

rubanraj54 commented 5 years ago

Hi @sdrig , Good to see you again here.

Yes, you're right. It is easy to implement inline add item row than a popup.

I'll try to implement this feature in this month end.

Cheers, Ruby.

tebenk commented 4 years ago

no update on this feature yet?

timsayshey commented 4 years ago

Has anyone found a workaround to add inline editing to this project? Seems like this issue has been abandoned.