Custom delete message

Custom delete message

bfarkasbfarkas Posts: 181Questions: 48Answers: 0

I have setup the custom delete message shown here:
https://editor.datatables.net/examples/api/removeMessage.html

I have been trying to get it to show both first and last name in the list, but keep not quite getting there. I feel like this should be a simple add, any thoughts?

Replies

  • rf1234rf1234 Posts: 3,021Questions: 88Answers: 421
    edited September 2020

    This should work:

    formMessage: function ( e, dt ) {
       var selected = dt.rows( {selected: true} ).data().toArray();
       var namesStr = '';
       $.each(selected, function(key, value) {
           namesStr += ( value.first_name + ' ' + value.last_name + '</li><li>' );
       })
       return 'Are you sure you want to delete the entries for the '+
              'following record(s)? <ul><li>' + namesStr + '</li></ul>';
    }
    
  • bfarkasbfarkas Posts: 181Questions: 48Answers: 0

    Perfect, so simple I don't know why I was going so crazy on it.
    Thanks!!

This discussion has been closed.