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

kendo grid not showing the data

0 Answers 45 Views
Google Android
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
dishank
Top achievements
Rank 1
dishank asked on 17 Aug 2016, 09:08 AM

I m working with kendo grid on mobile using java rest service. The response is in the form of an json array but still no data is shown in the kendo grid.

here is my code.

 

$(document).ready(function () {
    //DataSource definition
    
   // console.log(user);
   var data = new kendo.data.DataSource({
    dataType: "json",

        transport: {
            read: {
            type: "POST",
                url: "http://localhost:8079/Server/app/policy/getAll",
              
                data: user
            },
            parameterMap: function (data, operation) {
                return JSON.stringify(data);
            }
            },
     
        batch: true,
        //pageSize: 20,
      schema: {
     
        parse: function (d) {
                 // Get total_approved_products and display alert.
                 alert(d);
                 // Return data in order to be included in the `DataSource.data`
                 return d;
             },
        model: {
         
            fields: {
            idd: { type: "number" },
            relation: {  type: "string" },
            dependent: { type: "string" } 
            }
        },
       
        } 
      
    });
   console.log(data);
    //Grid definition
    var grid = $("#grid").kendoGrid({
        dataSource: data,
        selectable: true,

        pageable: true,
        //height: 430,
       // toolbar: ["create"],
        columns: [
                  { field:"idd", title: "idd" },
                  { field:"dependent", title: "dependent" },
                  { field:"relation", title: " relation " },
                   { command: { text: "View Details", click: showDetails } }
                 ],
                  //bind click event to the checkbox
        //editable: "inline"
    });

    //grid.data("kendoGrid");


    
}); 

Tags
Google Android
Asked by
dishank
Top achievements
Rank 1
Share this question
or