how to pass a column id to another datatable which is on next page

how to pass a column id to another datatable which is on next page

psYch022psYch022 Posts: 6Questions: 4Answers: 0

i want to make a column which has button
so when user press that button the extra data from sql is shown on another datatable

Answers

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    hello
    first get the row id on button click and call the next datapage url with this parameter

            $('#example').on( 'click','tbody tr', function () {
                var ID = table.rows($(this)).data().toArray()[0]['ID'];
                window.location.replace('NextDatapage.php?ID='+ID);
            } );
    

    in the NextDatapage.php get the passed ID and manage dataset using it

        $(example).ready(function() {
            var table = $('#example').DataTable( {                      
                ajax: "getdata.php?ID=ID",
    
This discussion has been closed.