Can I change sEmptyTable after the table was initialized?

Can I change sEmptyTable after the table was initialized?

ernopernop Posts: 3Questions: 0Answers: 0
edited August 2012 in General
It seems like I should be able to do it. At least, javascript is mutable & I just need to figure out where it's being stored, and change it... and then next time a table gets empty, datatables will consult that value and show it... right?

Replies

  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    That is correct - you can do it using the private settings parameters, but their isn't a public API to do this at the moment, so it is possible that the method used will change between DataTables versions (albeit unlikely).

    So with the warning out of the way, you can do:

    [code]
    table.fnSettings().oLanguage.sEmptyTable = "Now empty";
    [/code]

    Allan
  • ernopernop Posts: 3Questions: 0Answers: 0
    Thanks, that works! I was almost there, just missing out the oLanguage part.
  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    Good :-).

    The oSettings object is fully documented here: http://datatables.net/docs/DataTables/1.9.3/DataTable.models.oSettings.html . However not all parameters can be dynamically changed and actioned like that - which is why this isn't really public API.

    Allan
This discussion has been closed.