timwis / dataface

Build and manage data with a spreadsheet-like interface
https://dataface-demo.herokuapp.com
43 stars 4 forks source link

Right-clicking a row should have an "Add row" option to insert mid-table #28

Open timwis opened 7 years ago

timwis commented 7 years ago

Option A

  1. Send an empty insert to the server to get back its primary key.
  2. Insert that new row into the expected spot in the rows state (when the user refreshes, it will appear at the bottom but that's probably okay)
  3. Wait until the server responds before rendering, to eliminate the race condition of the user editing the row before a primary key is established

Option B

  1. Create a row in the state that has a special key, like _new: true
  2. When saving, check for that special key and do an insert instead