Jsgrid: Batch Editing

Created on 24 Apr 2017  路  5Comments  路  Source: tabalinas/jsgrid

Hi.

Firstly, thank you so much for your great grid editor. I've just started using it in the past two weeks and it's been great. My client now has a request to do batch editing.

I've been able to get part of it working, but when I click the external "Save Batch" button, I can't get the updated data for each row, only the last row.

See my JSFiddle here https://jsfiddle.net/GlennSuperdude/4u6xp3t3/
(In my real code, I'm using AJAX calls for the CRUD operations, but only using static data for the fiddle.)

When I'm looping over the rows during the save routine, I don't think the current edit row is being set correctly.

Thank you in advance for your help.

Regards,

Glenn.

help wanted

Most helpful comment

@GlennSeymon and @tabalinas ,
Thanks for this comments, it helps me a lot. @GlennSeymon, thanks for your jsfiddle.

I have tried something. I have updated that in Glenn's fiddle here : updated fiddle

Now Batch Edit is working. Sorry Glenn but I have updated Edit and Update both. But it will need much more testing with other functionalities. @tabalinas you can help me in that. After then only, we can add this into jsGrid. #757

All 5 comments

Sorry, link should have been:
https://jsfiddle.net/GlennSuperdude/4u6xp3t3/88

@GlennSeymon, thank you for the feedback.

Your example doesn't work because jsGrid fields assumes that you edit only single row at a time:
https://github.com/tabalinas/jsgrid/blob/master/src/fields/jsgrid.field.text.js#L58
As you see field stores a reference to the editControl of the last row, so as a result your have only last edited row.

As an alternative look at my suggestion to following issue:
https://github.com/tabalinas/jsgrid/issues/357#issuecomment-232976327

So the user can edit only one row at a time, you don't send data to the server at once, but accumulate changes locally. And send them when all batch updates are done.

Thanks for your feedback

I did see this issue (357) but found that the save button for each row needs to be clicked, rather that one button to save all rows.
If this isn't possible, I'll unfortunately have to find another grid plugin.
Thks.
Glenn.

@GlennSeymon and @tabalinas ,
Thanks for this comments, it helps me a lot. @GlennSeymon, thanks for your jsfiddle.

I have tried something. I have updated that in Glenn's fiddle here : updated fiddle

Now Batch Edit is working. Sorry Glenn but I have updated Edit and Update both. But it will need much more testing with other functionalities. @tabalinas you can help me in that. After then only, we can add this into jsGrid. #757

@Sachin4dotnet great. when updated only get fileds edit. How to get all data of row (included data change).

Was this page helpful?
0 / 5 - 0 ratings