This is a migrated thread and some comments may be shown as answers.

kendo-datasource with a custom response?

1 Answer 21 Views
This is a migrated thread and some comments may be shown as answers.
Maximiliano
Top achievements
Rank 1
Veteran
Maximiliano asked on 05 Apr 2019, 10:02 PM

Hi,

 

i'm using a kendo-datasource-wrapper with a grid wrapped as well.

the thing is that from the server i'm getting this by design

{
    result: true/false,
    data: [], // Array with the data for the grid
    message: '' // this one is in case of an exception this will show the message in the UI
}

 

the thing is that i don't know how to parse that data to show it in the grid is there any way?

 

 

Thanks.

Regards!

1 Answer, 1 is accepted

Sort by
0
Maximiliano
Top achievements
Rank 1
Veteran
answered on 06 Apr 2019, 09:11 AM

 

Answering to my own quetion

 

new kendo.data.DataSource({
          transport: {
            read: {
              url: "/api/usuarios/list",
              dataType: "json"
            }
          },
          schema: {
            parse: function (data) {
              return data.Data;
            }
          }
        })
Asked by
Maximiliano
Top achievements
Rank 1
Veteran
Answers by
Maximiliano
Top achievements
Rank 1
Veteran
Share this question
or