Open barrymichaeldoyle opened 7 years ago
Well i am facing the same issue right now. Any help ?
@barrydoyle18 @niranthreddy I am having the same issue. Have you guys find the problem yet?
have you tried setting a breakpoint in dev tools and have a look at the structure of the response to the ajax call?
anyone figure this out? My json response looks fine to me but im still hitting this error :(
Could you post the json response? Anytime I get this issue, the problem turns out to be a miss formed json response. As you know, by default the plugin expects the response object to contain (among other attributes) rows: { rows: [ { id: 1, name: 'Bla'}, { id: 1, name: 'Bla2'},....]}. So, even if your response contains 'rows', make sure its an array. Even if it's an empty array.
Solution is to add strings at the beginning and the end of json results.
The response's format expect plugin like @ksidibe says:
{ "current": 1, "rowCount": 10, "rows": [ { "id": 19, "sender": "123@test.de", "received": "2014-05-30T22:15:00" }, { "id": 14, "sender": "123@test.de", "received": "2014-05-30T20:15:00" }, ... ], "total": 1123 }
The format of a JSON obtained vía json_encode PHP function (i'm converting a laravel object)
[ { "id": 19, "sender": "123@test.de", "received": "2014-05-30T22:15:00" }, { "id": 14, "sender": "123@test.de", "received": "2014-05-30T20:15:00" }, ... ]
As can you see, json don't have the begging and the end of response plugin expect.
Then i solved that adding a few string like this
return ('{"rowCount": 10,"rows":'. json_encode($myqueryobject).',"total": 1123}');
$myqueryobject is the query i made using laravel eloquent in my case 10 and 1123 can be replaced getting the data of a query.
hope it helps.
regards
I have the following error when trying to run my bootgrid:
I have implemented my bootgrid as follows:
Any idea what would be causing this? :/