Editor - inline editing for entire table

Editor - inline editing for entire table

jacktrapjacktrap Posts: 14Questions: 6Answers: 0

Hello,

I'm using inline editing for table is full of checkboxes (data is all booleans).

The client doesn't like that they have to click the field once to enable editing and then click again to check/uncheck the chekbox. What they want is to be able to enable editing on the entire table, then modify whatever fields they want, and then hit a save button which will save all changes together.

I can't find an example of this.

I have an idea of how to do it but I was wondering if anyone else has done it or if there's any inbuilt way of acheiving this?

Basically

1) Click button to enable edit mode on entire table
2) Make any changes locally in the table that you wish,
3) Click button to submit all changes to server.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    That's not possible by default, as all edits would be submitted by the server, whether that be a single inline field or when editing in the main form.

    That said, you can try queuing changes, as demonstrated in this blog post here.

    Colin

  • rf1234rf1234 Posts: 2,801Questions: 85Answers: 406
    edited December 2019

    Even though it might sound strange: If you use checkboxes in your table but do not use Editor inline editing you do not have to click again to check/uncheck the checkboxes.
    This example has it: https://editor.datatables.net/examples/api/checkbox

    Now you could of course use multiple checkboxes and only do the editor submit on button click with a custom button for example.

    I use a similar logic to allow the user to logically delete records or mark them as "read" by clicking the checkbox.

    I have Editor inline editing with a checkbox as well - and don't like it because the users have to click on the field and then again to check the box. Unfortunately I had forgotten about the simple solution from my own older code and the example above. Thanks for making me aware of this again!

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Thanks, @rf1234, that's a good suggestion.

  • rf1234rf1234 Posts: 2,801Questions: 85Answers: 406

    Just took my own medication and changed my repective inline editable table:
    Now all columns except for the one with the checkbox are editable inline. The checkbox column works like in the linked example above.

    For the user everything still looks like "inline editing" but it is much better because the checkbox column is much easier to edit now.

This discussion has been closed.