executing PHP in Column via .DataTable()

executing PHP in Column via .DataTable()

dejanjuergenwolfdejanjuergenwolf Posts: 3Questions: 2Answers: 0
edited August 2017 in Free community support

Hi,

I want to execute a PHP code in a column.

I've tried this:

var atable = $('#dataAddressTable').DataTable({
draw: $('.userExist').html( $.get( "template.checkUserExist.php" ) ),
[....]
});

but the Code runs only on the first Page.

Answers

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    There isn't a draw initialisation option, so I'm not actually sure what that code is doing. I think it is writing an Ajax object into your .userExist elements since $.get is async (unless you have changed that else where).

    Do you want to run that for every row? I'd really recommend against making an Ajax request for every row. Can you not just include that data in the HTML or JSON (depending on how it is being loaded - without a test case, I've not not much information to go on).

    Allan

  • dejanjuergenwolfdejanjuergenwolf Posts: 3Questions: 2Answers: 0
    edited August 2017

    hey Allen and thank you for your reply,

    I got deferRender: true and scroller: true, so when I put the code in defaultContent it will display the code as text on the further pages. And the table data comes from a JavaScript Array.

    And yes I want to run in for every row.

This discussion has been closed.