How can I bind onclick event in pagination button

How can I bind onclick event in pagination button

jemzjemz Posts: 131Questions: 40Answers: 1

Hi, I need some help please,Is it possible to bind on click event on the pagination button ?then get the json data returned by the server,because I have something to do with the data that was being return,

Thank you in advance.

  $('#example').dataTable( {
                        "processing": true,
                        "serverSide": true,
                        "start": 0,
                        "ajax": {
                            url:"querydata.php?devid="+empid

                        },
                        "columns": [
                            { "data": "empid" },
                            { "data": "firstname" },
                            { "data": "lastname" },
                            { "data": "age" }

                        ]
                    } );

This question has an accepted answers - jump to answer

Answers

  • jemzjemz Posts: 131Questions: 40Answers: 1

    I am using latest version DataTables 1.10.2

  • MuhaheMuhahe Posts: 25Questions: 8Answers: 2
    edited September 2014

    Hi, try drawCallback, its called every time, table is redrawn

  • jemzjemz Posts: 131Questions: 40Answers: 1

    ok let me try..thank you I will be back

  • jemzjemz Posts: 131Questions: 40Answers: 1

    Hi, Thank you it works,but how can I get data inside the drawCallback function,because I have something to do with the data that was being returned..

    Thank you in advance.

  • MuhaheMuhahe Posts: 25Questions: 8Answers: 2
    Answer ✓

    Try drawCallback like this

    "drawCallback": function(settings){
    
    }
    

    and in variable settings i have aoData array which contains all rows in table. Hope this will help

This discussion has been closed.