Get page number that clicked on

Get page number that clicked on

number30number30 Posts: 2Questions: 1Answers: 0

i wannna get the number (text ) of pagination numbers and send that to server for load data of that page
for example if user click on page number 3 , i load data of that page
i saw this code :

$('#tblMain')
.on('page.dt', function (ev) { console.log(ev); })
.DataTable();

but it's event does not contain the button's information that clicked
what should i do ...
thanks for any help

Answers

  • number30number30 Posts: 2Questions: 1Answers: 0

    i found my answer :

    var table = $('#example').DataTable();

    $('#example').on( 'page.dt', function () {
    var info = table.page.info();
    $('#pageInfo').html( 'Showing page: '+info.page+' of '+info.pages );
    } );

This discussion has been closed.