How should oLanguage be passed to dataTable.defaults?

How should oLanguage be passed to dataTable.defaults?

korukyukorukyu Posts: 11Questions: 0Answers: 0
edited July 2012 in General
I'm trying to set oLanguage's values in $.fn.dataTable.defaults, but it doesn't seem to work. In fact, when it's included, none of the other defaults work, either.


http://live.datatables.net/eselem/
Here adding the oLanguage variable makes the table ignore the bPaginate completely because oLanguage is set.

http://live.datatables.net/eselem/2/
But here the pagination works fine without oLanguage set.

This is really weird, since the page on dataTable.defaults says that it takes all the same parameters as a regular initialization. Does anyone know how to make it accept oLanguage?

Thanks!

Replies

  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    It does take the same parameters, but your need to deep copy the objects, not shallow copy :-). As it was you were overwriting the DataTables full default set! All you need to do is pass in 'true' as the first parameter to $.extend: http://live.datatables.net/eselem/3/edit

    Allan
  • korukyukorukyu Posts: 11Questions: 0Answers: 0
    I don't know what that means, but it works.

    Thanks!
This discussion has been closed.