Data input

Data input

alcomalcom Posts: 9Questions: 0Answers: 0
edited April 2011 in General
I figured out how to format json output. However, now I have a problem understanding how to get ajax source.

In my controller i have set a variable that holds a string of formated data:

$json = { "aaData":[["kofefehe905","127.0.0.1","kofefehe905@example.com",991200833,2,"Normal"],["newapigo5813","127.0.0.1","newapigo5813@example.com",991200833,2,"Normal"]] } ;

How do i load it to datatables without echoing it?

This does not work:

$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": <?= $this->json ?>
} );
} );


Thanks

Replies

  • alcomalcom Posts: 9Questions: 0Answers: 0
    I mean:

    $json = '{ "aaData":[["kofefehe905","127.0.0.1","kofefehe905@example.com",991200833,2,"Normal"],["newapigo5813","127.0.0.1","newapigo5813@example.com",991200833,2,"Normal"]] }' ;

    This string is a formatted output from a db query.
This discussion has been closed.