Saving Data with Row ID of the record itself from database-table

I’m trying to enable Update/Save feature of Handsontable. But the afterChange only returns auto-generated row index and col with Old and New Value on it.

What I want to do here is to update the Records within Handsontable and send request to the server for MySQL Update Query with the record ID on it.

How can we do that in Handsontable? I hope I made my point here, thank you

Hi @e.reveriza

What result you would like to get from afterChange to proceed with your task?

The current value of the “change” parameter from the **afterChange** is shown below…

[ [ 0, "company", "Anthem Health Plans, Inc", "Anthem Health Plans" ] ]

And I want it if possible the value should be

[ [ Record_ID, "company", "Anthem Health Plans, Inc", "Anthem Health Plans"] ]

Where Record_ID is the ID of the record from DB-Table.

Just so I can build a MySQL query like … UPDATE tablename SET company=newName WHERE Record_ID = ???

If this is possible how would I assign the Record_ID to each and every corresponding record in the Handsontable.

Hi,

Exactly i am also looking for same if select any cell only index i am getting index not row id(primary key)
data like if select any 1 row cell [o,fieldname,oldvalue,newvalue]

Hi @e.reveriza @chandrababu416
Here’s a demo I’ve made some time ago for object type data and afterChange hook I hope it will come in handy

@aleksandra_budnik … what demo? I can’t see any link to the demo here … please provide a link Thank you

oh sorry @e.reveriza
you’re right - I didn’t add the link. Please, here it is http://jsfiddle.net/c9xk156b/