Footer functions don't work when JSON language file is used
Footer functions don't work when JSON language file is used
After spending hours trying to insert total of all values in specified columns ( as per example in https://datatables.net/reference/api/column().footer() ) I couldn't get it to work. After debugging I found out this:
Function only works when language option is not used (or translations are provided as arguments instead of URL with JSON file). My first thought was that localization file was corrupt, but I noticed it happens with all "official" translation files.
I made an example, where total of "Age" column is added to the footer of the same column, it works fine:
http://live.datatables.net/nukaqaqe/1/edit
Now see what happens if I configure DataTables to use JSON file with translations ( as per instructions on https://datatables.net/plug-ins/i18n/ )
http://live.datatables.net/depopoqo/1/edit (custom content is not added to footer).
I strongly believe this is a bug, unless I missed something?
Replies
I think you missed this part of the
language.url
documentation:Here is your example using
initComplete
: http://live.datatables.net/depopoqo/2/edit .Allan
Thank you, that really was the reason why footer function didn't work.