sAjaxSource...

sAjaxSource...

narutimateumnarutimateum Posts: 12Questions: 0Answers: 0
edited June 2011 in General
Dear mr allan...what is sAjaxSource...i meant....do you have like a sample of those ajax script would looks like??the sources i mean....because most of the examples here is more to the datatables side...there is not much of an example on the other side...

Replies

  • narutimateumnarutimateum Posts: 12Questions: 0Answers: 0
    ok i found the sources...now is it possible to have a join table in the ajax source??how do i do that?

    the script is this
    * Script: DataTables server-side script for PHP and MySQL
    * Copyright: 2010 - Allan Jardine
    * License: GPL v2 or BSD (3-point)
  • wraxouwraxou Posts: 3Questions: 0Answers: 0
    You could try to create a view and use it to fill in your table I guess.
  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin
    edited June 2011
    There are a range of server-side implementations for server-side processing and DataTables here: http://datatables.net/development/server-side/ (assuming you want to use server-side processing). Also all the scripts used for my demos are included on the example page (like here: http://datatables.net/release-datatables/examples/server_side/server_side.html ) or in the DataTables package (examples/server_side/scripts).

    There is also documentation on server-side processing for DataTables here: http://datatables.net/usage/server-side

    To do a 'join' of multiple tables for the server-side processing scripts, you'll need to modify the aColumns ans sTable parameters. There are a number of posts in the forums showing how to do that. You will need to modify the code that is available from the above links to do this as there currently isn't a join example.

    Allan
  • numberonenumberone Posts: 86Questions: 0Answers: 0
    edited June 2011
    you can use https://github.com/n1crack/IgnitedDatatables-native-php-version for multiple tables.

    your ajax file will be like :
    [code]
    <?php
    require_once('Datatables.php');
    $datatables = new Datatables();

    // MYSQL configuration
    $config = array(
    'username' => 'root',
    'password' => '',
    'database' => '',
    'hostname' => 'localhost');

    $datatables->connect($config);

    $datatables
    ->select('film.film_id as id, title, description, release_year')
    ->from('film')
    ->join('category', 'category.category_id = film.film_id' )
    ->select('name');

    echo $datatables->generate();

    ?>
    [/code]

    and thats it.


    about Ignited Datatables Library :
    http://datatables.net/forums/discussion/5133/ignited-datatables-native-php-version
  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin
    How cool is that - nice one numberone :-)

    Allan
  • narutimateumnarutimateum Posts: 12Questions: 0Answers: 0
    waa...tqvm
  • rreinschrreinsch Posts: 1Questions: 0Answers: 0
    Hi There,
    numberone this is AWESOME!! Question though.. How would i do a SELECT CONCAT? It's not working for me. Thanks
  • allanallan Posts: 63,531Questions: 1Answers: 10,475 Site admin
    Concat is an SQL function, so you would be better asking in an SQL forum or consulting the documentation for your DB - here is the MySQL doc: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html .

    Allan
This discussion has been closed.