Jsgrid - Load Json Data - "not Found"
I have a problem populating a jsgrid from with JSON data and I have scaled down the code to a very minimal implementation but it is still not working. I can see in the Chrome debug
Solution 1:
The format of returned data should be an array of items, not a JSON object with data
field.
Note that for loading by page (pageLoading: true
) this format is different: { data: [arrayOfItems], totalCount: amountOfItems }
.
For the code above you could do the following:
loadData: function (filter) {
console.log(filter);
return $.ajax({
type: "GET",
url: "http://localhost:8888/GetListJSGrid",
data: filter,
dataType: "json"
}).then(function(result) {
return result.data;
});
}
Solution 2:
Ok, I solved. It seems that the documentation is not updated for JSGrid or that I have missed something here.
By comparing the response from the link below that is working in JSGrid
I noticed that the following JSON is accepted by JSGrid {"value": [{ "Name":"MyAccount"}]}
Post a Comment for "Jsgrid - Load Json Data - "not Found""