Datatables change language dynamically

前端 未结 4 784
一整个雨季
一整个雨季 2021-01-06 13:04

I\'m trying to change with jQuery language of a table with datatables. I\'m trying to push a button to change the language of the table.

$(\'#prueba\').live(         


        
4条回答
  •  萌比男神i
    2021-01-06 13:42

    As the original poster mentioned, this does not work:

    tablacliente.fnSettings().oLanguage = espanol;    // does not work!
    

    but something like this should work, without having to destroy the table:

    var oLanguage = tablacliente.fnSettings().oLanguage;
    for (var field in espanol) {
        oLanguage[field] = espanol[field];
    }
    

提交回复
热议问题