asp.net - Kendo Grid not binding to JSON result from ASMX Web Service -
i have problem binding kendo grid asp.net asmx web service.
following html code
<!doctype html> <html> <head> <title></title> <link rel="stylesheet" href="styles/kendo.common.min.css" /> <link rel="stylesheet" href="styles/kendo.default.min.css" /> <link rel="stylesheet" href="styles/kendo.dataviz.min.css" /> <link rel="stylesheet" href="styles/kendo.dataviz.default.min.css" /> <link href="styles/kendo.common-bootstrap.min.css" rel="stylesheet" /> <link href="styles/kendo.bootstrap.min.css" rel="stylesheet" /> <link href="../bootstrap/bootstrap.min.css" rel="stylesheet" /> <script src="../scripts/jquery-2.0.3.min.js"></script> <script src="js/kendo.all.min.js"></script> <script src="../bootstrap/bootstrap.min.js"></script> </head> <body> <div id="example"> <div id="grid" class="table table-bordered"></div> <script> $(document).ready(function () { $("#grid").kendogrid({ columns: [ { field: "srno", title: "srno" }, { field: "party", title: "party" } ], datasource: new kendo.data.datasource({ transport: { read: { url: "../service/databasehandling.asmx/getpurchasejangad_json", datatype: "json", contenttype: "application/json; charset=utf-8" } } }), schema: { data: "d" }, sortable: true }); }); </script> </div> </body> </html>
json returned service looking ok below.
{"d":"[{\"srno\":17,\"party\":\"paresh\",\"dt\":\"11/5/2015\",\"weight\":15000.0,\"timestamp\":\"2015-05-11t20:19:55.093\"},{\"srno\":18,\"party\":\"sim\",\"dt\":\"11/5/2015\",\"weight\":11000.0,\"timestamp\":\"2015-05-11t20:21:44.177\"}]"}
still nothing visible on grid. , no error in browser console.
i think issue json data only.
modified json given below, replaced \" " , removed quote before , after square brackets
{"d":[{"srno":17,"party":"paresh","dt":"11/5/2015","weight":15000.0,"timestamp":"2015-05-11t20:19:55.093"},{"srno":18,"party":"sim","dt":"11/5/2015","weight":11000.0,"timestamp":"2015-05-11t20:21:44.177"}]}
Comments
Post a Comment