Paging shown twice in .dataTable() during localization

I develop a PHP Zend Framework website. The table rows are displayed in table format using dataTables (www.datatables.net). The API is great and works wonderfully. My site is implemented in 2 languages currently – English(default) & German. So I tried implementing localization like given in http://www.datatables.net/examples/advanced_init/language_file.html

I added this code in my .phtml file

[PHP CODE - CHECK IF $_COOKIE['lang_code'] IS SET] [SCRIPT CODE START] $(document).ready(function(){
oTable = $('#example, #subscribed_docs_table, #changed_subscribed_docs_table').dataTable({
"oLanguage": {
"sUrl": "baseUrl();?>/media/language/.txt"
},
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
});
[SCRIPT END] [PHP CONDN BLOCK END]

It was simply loading for unlimited time. I couldn’t figure the issue and did not do what to do. I moved this code to the bottom after

generation code. But that also did not help.

Then I started changing the order of parameters passed to oTable and set it like below.

$(document).ready(function(){
oTable = $('#example, #subscribed_docs_table, #changed_subscribed_docs_table').dataTable({

"bJQueryUI": true,
"sPaginationType": "full_numbers",
"oLanguage": {
"sUrl": "baseUrl();?>/media/language/.txt"
}
});
});

Now you will not believe me.. IT WORKED.

Now it is perfectly showing the content properly with localization.

Share This

Leave a Reply

Your email address will not be published. Required fields are marked *


7 + two =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>