Doesn't show data from server side..
Doesn't show data from server side..
I tried http://datatables.net/examples/data_sources/server_side.html on data retrieval and i got
{"sEcho": 0, "iTotalRecords": 12, "iTotalDisplayRecords": 12, "aaData": [ ["superstreet, university of the philippines los banos, los banos, laguna","house&lot","300","2500000",""],["up los banos laguna","apartment","2500","15000000",""],["los banos laguna","house&lot","80","750000",""],["los banos laguna","house&lot","120","1500000",""],["uplb laguna","house&lot","150","1750000",""],["uplb","condominium","50","1000000",""],["los banos laguna","house&lot","150","1777000",""],["uplb los banos laguna","apartment","10000","50000000",""],["national highway calamba city","lot only","0","3000000",""],["","condominium","78","3500000",""],["","lot only","0","3000000",""],["","lot only","0","22000000",""]] }
(*nevermind the data is all dummy data...*)
validated on http://www.jsonlint.com/ and 100% ok... but the thing is It didnt show on the table
[code]
$(document).ready(function() {
$('#myTable').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "default.php"
} );
} );
[/code]
and my table looks like this
[code]
Location
Type
Area(sqm)
Price
Extra
Loading data from server
[/code]
{"sEcho": 0, "iTotalRecords": 12, "iTotalDisplayRecords": 12, "aaData": [ ["superstreet, university of the philippines los banos, los banos, laguna","house&lot","300","2500000",""],["up los banos laguna","apartment","2500","15000000",""],["los banos laguna","house&lot","80","750000",""],["los banos laguna","house&lot","120","1500000",""],["uplb laguna","house&lot","150","1750000",""],["uplb","condominium","50","1000000",""],["los banos laguna","house&lot","150","1777000",""],["uplb los banos laguna","apartment","10000","50000000",""],["national highway calamba city","lot only","0","3000000",""],["","condominium","78","3500000",""],["","lot only","0","3000000",""],["","lot only","0","22000000",""]] }
(*nevermind the data is all dummy data...*)
validated on http://www.jsonlint.com/ and 100% ok... but the thing is It didnt show on the table
[code]
$(document).ready(function() {
$('#myTable').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "default.php"
} );
} );
[/code]
and my table looks like this
[code]
Location
Type
Area(sqm)
Price
Extra
Loading data from server
[/code]
This discussion has been closed.
Replies
Thanks for posting back - I've just tided up the server-side usage page a bit to note the use sEcho a little bit more: http://www.datatables.net/usage/server-side . And also added this as an FAQ: "Its still not working..." http://datatables.net/faqs .
Regards,
Allan