Language configuration options for DataTables vs. page() and page.jumpToData() API

Language configuration options for DataTables vs. page() and page.jumpToData() API

delfdelf Posts: 3Questions: 2Answers: 0

Hi there,

I'm using DataTables 1.10.19 in CI framework and everything works great, except this one :
after inserting internationalisation plug-in, for example

language :{ url: 'http://cdn.datatables.net/plug-ins/1.10.19/i18n/Slovak.json'}

function page() and API's plug-in page.jumpToData() doesn't work anymore

Can you help me, please ? Thank you

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    The page() API works here with the language.url option. Not sure what you are doing but this note in the language.url option might help. If not please update my test case to replicate the issue.

    Note that when this parameter is set, DataTables' initialisation will be asynchronous due to the Ajax data load. That is to say that the table will not be drawn until the Ajax request as completed. As such, any actions that require the table to have completed its initialisation should be placed into the initComplete callback.

    Kevin

  • delfdelf Posts: 3Questions: 2Answers: 0

    Hi Kevin, thanx for care
    I wasn't accurately on problem describing, so :
    when in http://live.datatables.net/delemoca/2/edit replace js part with:

    $(document).ready( function () {
    $('#example').DataTable({
    language :{ url: 'http://cdn.datatables.net/plug-ins/1.10.19/i18n/Polish.json'}
    });
    var table = $('#example').DataTable();
    table.page( 4 ).draw( false );
    } );

    localization works correct, but table still stands on page 1
    (manually you can click on pag. btn 5, it works)

    with ajax data function table.page(x).draw(false) all works correct

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736
    Answer ✓

    Please read the note I posted from the language.url. Here is the updated test case using initComplete.
    http://live.datatables.net/delemoca/3/edit

    Kevin

This discussion has been closed.