inline form commands

inline form commands

vinod_ccvvinod_ccv Posts: 75Questions: 0Answers: 0
edited September 2012 in Editor
Hi,
I am new to this forum. Just working with examples (inline form commands) and found that DELETE link does not give any confirmation window. How to incorporate it with custom text message. I am also trying ,will let u know once i get a solution for that.
Once again thank u all members and admin of this forum.

Replies

  • allanallan Posts: 54,542Questions: 1Answers: 8,528 Site admin
    In the 'inline' example the setup code specifically says that it doesn't ask for a user's permission first:

    [code]
    // Delete a record (without asking a user for confirmation)
    $('#example').on('click', 'a.editor_remove', function (e) {
    e.preventDefault();

    editor.remove( $(this).parents('tr')[0], '123', false, false );
    editor.submit();
    } );
    [/code]

    To have the user confirm that they want to delete the row, you would do something like this (taken directly from the Editor documentation for the `remove` method: http://editor.datatables.net/api/#remove ):

    [code]
    // Delete a given row with a message to let the user know exactly what is
    // happening
    editor.message( "Are you sure you want to remove this row?" );
    editor.remove( row_to_delete, 'Delete row', {
    "label": "Confirm",
    "fn": function () { this.submit(); }
    } );
    [/code]

    Allan
  • vinod_ccvvinod_ccv Posts: 75Questions: 0Answers: 0
    Thank you ..It works for me. I should read the documents more..
This discussion has been closed.