TypeError: i is undefined
TypeError: i is undefined
testbakeca
Posts: 5Questions: 1Answers: 0
.));for(var i=Q(a.sAjaxDataProp)(b),f=0,g=i.length;f<g;f++)if(c){for(var e=[],h=0...
I'm trying to use the DataTable , when I try to read the JSON gives me this error
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.
Information on how to create a test page, if you can't provide a link to your own page can be found here.
Thanks,
Allan
Hello I understand what does not work .
WHEN I use an Object That returns the JSON gives me this:
{"success":1,"code":200,"messages":[],"content":{"sEcho":1,"iTotalRecords":10,"iTotalDisplayRecords"
:30,"aaData":[{"id":1,"name":"ffff","vuoto":"wwww"},{"id":2,"name":"ffff","vuoto":"wwww"}]},"follow"
:null}
if json_encode use it all works perfectly, and me from this
{"sEcho":1,"iTotalRecords":10,"iTotalDisplayRecords"
:30,"aaData":[{"id":1,"name":"ffff","vuoto":"wwww"},{"id":2,"name":"ffff","vuoto":"wwww"}]}
there is a way to make it work with the first json ?
You would need to use
ajax
as a function and make your own$.ajax
call. Then passjson.content
to the callback function.Allan
I am using DataTable 1.9 .
I can use fnserverdata ?
how can I do ?
"fnServerData": function( sUrl, aoData, fnCallback ) {
$.ajax({
"url": sUrl,
"data": aoData,
"success": function (json) {
I did so , alert the press the right result , how do I pass the result to datatable ?
fnCallback( json.content )
as I suggested above looks to be the way to do it.Allan
Thanks , it works :)