Multi-User Editing
Multi-User Editing
Hi,
I have a DataTable that allows users to update some pretty extensive content. As a result, a user could be editing an entry for quite some time. Which allows the potential for another user to open the same entry and update the same content. Are there any recommended ways to prevent two+ users from updating the same data at the same time?
I have a DataTable that allows users to update some pretty extensive content. As a result, a user could be editing an entry for quite some time. Which allows the potential for another user to open the same entry and update the same content. Are there any recommended ways to prevent two+ users from updating the same data at the same time?
This discussion has been closed.
Replies
Taking that a step further, another hidden field could be used to say "Someone has edited this record, click save again to overwrite their changes" - which might or might not be what you want. Certainly it will be slightly annoying for the user to need to reload the page and make their edits again.
An alternative option is to 'lock' the rows while an edit is taking place. This could be done by sending an Ajax request tot he server whenever a row is requested to be edited - if no one else is editing it, the edit can continue placing a lock into the row, if there is already a lock in place, tell the user that the row is locked.
This is probably a nicer user experience I think as they won't be able to make changes that might then be lost, although it can be a little bit of a pain if someone stops editing halfway through and doesn't cancel the edit (i.e. release the lock). There would need to be a timeout on the locks to stop this for disallowing all future edits.
Regards,
Allan
Thanks for the detailed response. I recently jumped back on the relevant project and implemented a solution. Each entry has an "isBeingEdited" field which is updated on form open/close. I've highlighted that closing is essential to prevent the need for a timed unlock. When the entry is already being edited, a pop up is displayed detailing who is currently editing.
This pop up is currently just an editor.remove() with the submit method stripped out and a custom message. There's currently no method to easily pop up a custom pop up with say, title / message/ button text is there?
That's a great idea for a future addition though - I'll look into adding that.
Regards,
Allan