Replace oSettings.oLanguage.sProcessing with error message

Replace oSettings.oLanguage.sProcessing with error message

vinodjayendravinodjayendra Posts: 5Questions: 0Answers: 0
edited March 2013 in DataTables 1.8
I am trying to replace the Processing.. text with the server side error message when an 500 error occurs .. the below snippet doesn't work, any pointers ?

fnServerData: function(sUrl, aoData, fnCallback, oSettings) {

....
error: function (jqXHR, textStatus, errorThrown) {

oSettings.oLanguage.sProcessing = "Server error :" + errorThrown

...
}
}

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    You should never change the values of the options in oSettings - DataTables doesn't know that you've changed them and therefore can't act upon them. I'd also say that sProcessing should not be used for an error message, it was not designed for that. If you want to show an error message you should define a way of showing it which is custom to your application.

    Allan
  • vinodjayendravinodjayendra Posts: 5Questions: 0Answers: 0
    Hi Allan,

    Thanks for the reply.

    I was trying to replicate the solution posted here:
    http://datatables.net/forums/discussion/3257/how-to-display-server-side-status-messages/p1

    by applying the changes to sProcessing element.

    But looks like i have to go down the path of defining my own custom error label and accessing it in the error function - would be useful if there any examples handy.
This discussion has been closed.