kendo display blank grid

1 posts, 0 answers
  1. dishank
    dishank avatar
    3 posts
    Member since:
    Jul 2016

    Posted 19 Aug Link to this post

    using kendo grid for cordova android . if a json object is passed then it is shown in the grid if a json array is passed then blank grid is shown.

    the json array is in the format:


    The code for kendo grid is 

    $(document).ready(function () {<br>    var user={"user":"dishank"}<br>   var data_Source = new{<br>   <br><br>        transport: {<br>            read: {<br>            //dataType: "json",<br>            type: "POST",<br>                url: "http://localhost:8079/Server/app/policy/getAll",<br>                data: user<br>            },<br>            parameterMap: function (data, operation) {<br>                return JSON.stringify(data);<br>            }<br>            },<br>     <br>        batch: true,<br>        //pageSize: 20,<br>      schema: {<br>     // data:"details",<br>                      data: 'data',<br>         parse: function (d) {<br>                 // Get total_approved_products and display alert.<br>                 alert(d);<br>                 // Return data in order to be included in the ``<br>                 return d;<br>             },<br>         model: {<br>            fields: {<br>           idd: { type:"string" }, <br>           relation: {  type:"string" },<br>           dependent: { type:"string" } <br>            }<br>        }, <br>       <br>       } <br>      <br>    });<br>    //Grid definition<br>    var grid = $("#grid").kendoGrid({<br>        dataSource:data_Source,<br>        selectable: true,<br><br>        pageable: true,<br>        //height: 430,<br>        <br>       // toolbar: ["create"],<br>        columns: [<br>                { field:"idd", title: "user_id" },<br>                  { field:"dependent", title: "dependent" },<br>                  { field:"relation", title: "relation" },<br>                   { command: { text: "View Details", click: showDetails } }<br>                 ],<br>                  //bind click event to the checkbox<br>        //editable: "inline"<br>    }).data("kendoGrid");<br><br>    //"kendoGrid");<br><br><br>    new, { skin: "nova" });<br>}); <br>

Back to Top