How to use PHP with Scroller

How to use PHP with Scroller

DataTablesNewGuyDataTablesNewGuy Posts: 9Questions: 4Answers: 0
edited October 2014 in Free community support

I followed the Scroller example successfully:
http://datatables.net/release-datatables/extensions/Scroller/examples/simple.html

I want to use my PHP script to connect to a MS SQL database and return the correct JSON. I used PHP in other datatables but do not know how to use it with scroller.

How do I alter the following javascript to call a PHP file instead of the file 2500.txt?

          $(document).ready(function () {
                      $('#example').DataTable({
                           ajax: "../php/2500.txt",
                          deferRender: true,
                            dom: "frtiS",
                           scrollY: 200,
                         scrollCollapse: true
                      });
                   });

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    Answer ✓

    Change:

    ajax: "../php/2500.txt",

    to:

    ajax: "../php/2500.php",
    

    or whatever the URL of your PHP file is :-).

    Allan

This discussion has been closed.