Custom Message On Remove

Custom Message On Remove

ciroracirora Posts: 29Questions: 2Answers: 1
edited August 2014 in Free community support

Hi,
when I remove some rows, this message "Are you sure you wish to delete n rows?" is shown. How Can I customize it?

Replies

  • ciroracirora Posts: 29Questions: 2Answers: 1

    I found this: http://editor.datatables.net/examples/simple/i18n.html
    but it doesn't work in my code:

    
    editor = new $.fn.dataTable.Editor( {
           table: idTabella,
           "idSrc":idSrc,
           i18n:{
           ajax: {
                remove: {
                    type: 'POST',
                    confirm: {
                        _: "Etes-vous s??r de vouloir supprimer %d lignes?",
                        1: "Etes-vous s??r de vouloir supprimer 1 ligne?"
                    },
    
                    url: removeUrl
                },
                create:{
                    type:'POST',
                    url:createUrl
            },
                edit:{
                    type:'POST',
                    url:editUrl
                }
            },
            fields: CampiInserimento, //i campi per il form di inserimento
            }
        } );
    
  • mRendermRender Posts: 151Questions: 26Answers: 13
    // 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(); }
    } );
    

    Found from this page: http://editor.datatables.net/docs/current/Editor.html#remove

  • ciroracirora Posts: 29Questions: 2Answers: 1

    ok, thanks,
    but if I want to use this code, I have to add extra code to get "row_to_delete",
    I thought there was something similar to oLanguage setting also for the editor...

This discussion has been closed.