inline Editor: is label necessary ?

inline Editor: is label necessary ?

gravstengravsten Posts: 14Questions: 5Answers: 0

Hi,

In the "Selected columns only" example, all editing is done inside the cell (no modal) :
https://editor.datatables.net/examples/inline-editing/columns.html

Thus I am wondering what is the use of labels in fields, e.g. label: 'First name:' ?

And in order to use my own REST interface (without the DataTables_Editor_PHP which is overkill for my small table), I hesitate between pointing the Editor's ajax to my own custom PHP endpoint (is there any example that describes the ajax POST messages ?) or use blur event on each cell to call my own custom ajax code.

Which do you suggest is better ?

Answers

  • kthorngrenkthorngren Posts: 20,366Questions: 26Answers: 4,777

    In the "Selected columns only" example, all editing is done inside the cell (no modal) :smile:

    In that example you can use inline editing or a modal by selecting the row and clicking the Edit button.

    Thus I am wondering what is the use of labels in fields

    See the fields.label docs for details but its used. The docs explain that its not required. So if all you have enabled is inline editing you don't need to define the fields.label option.

    is there any example that describes the ajax POST messages

    See the Client / server data docs for details.

    or use blur event on each cell to call my own custom ajax code.

    I think that would negate the usefulness of the Editor client code. You would then need to provide a way to update the cell if the server responds with success or perform any error handling.

    Kevin

  • gravstengravsten Posts: 14Questions: 5Answers: 0

    Thank you very much for the advice.

    I ended up using the Editor client/server protocol, which was quite easy:
    $data = $_POST['data'];

Sign In or Register to comment.