kendGrid schema , remote json

1 Answer 21 Views
Grid
Steinar
Top achievements
Rank 1
Iron
Steinar asked on 25 Feb 2022, 09:34 AM

Just trying to test out Kendo and as a first test making a grid using remote json , i'm not able to make it work.

If I just return pure json array holding the data array as only returned value , and not defining data or total in the schema , then it works.

But I need to include data value of "total", and the returned grid array in "items" - I'm not getting any entries in the Grid.

schema: {
   type: "json",
   data: "items",
   total: "total",
.....

I do get the total value from the response , but no data in the grid from the "items"  and no error messages

If I define data: as
data: function (response) {
   console.log(response.items);
  return response.items;
}
Then i see the grid data in my response.items , but not rendered in the Grid

as : [{"OrderID":762884,"Freight":11581,"Ship .........

Thank you for your help here

1 Answer, 1 is accepted

Sort by
0
Steinar
Top achievements
Rank 1
Iron
answered on 25 Feb 2022, 04:25 PM

Well - after more triel I found that I in data : function had to return an array - not the json .
I added   return $parseJSON(  My.Json );   and it now works

 

 
Tags
Grid
Asked by
Steinar
Top achievements
Rank 1
Iron
Answers by
Steinar
Top achievements
Rank 1
Iron
Share this question
or