$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
type: "jsonp",
serverPaging: true,
serverSorting: true,
pageSize: 13,
transport: {
read: "../../emrwebservices/service.asmx/getSampleSQLDataKendo"}
},
schema: {
data: 'items',
total : function(data) {return data.totalCount;
}
},
height: 250,
scrollable: true,
sortable: true,
pageable: true,
columns: [
{ field: "userID", title: "User ID" },
{ field: "fullName", title: "Name" },
{ field: "userName", title: "User Name" },
{ field: "eMail" },
{ field: "isActive"}
]
});
});
Web Service data is below. Also viewable at http://www.speechtodocs.com/emrwebservices/service.asmx
{"totalCount":80,"items":[{"userID":"227","fullName":"Dr. Hank Aaron","userName":"HankAaron","eMail":"melissa@dmmt.com","isActive":"True"},{"userID":"197","fullName":"Dr. Jeffrey Aronoff","userName":"4690","eMail":"melissa@dmmt.com","isActive":"True"},{"userID":"189","fullName":"Dr. Sunil Asnani","userName":"4749","eMail":"melissa@dmmt.com","isActive":"True"},{"userID":"165","fullName":"Dr. Kalman etc..................<script type="text/x-kendo-template" id="template"><div class="tabstrip"><ul><li>Adressen</li><li class="k-state-active">Kontakte</li></ul><div><div class="addresses"></div></div><div class="contacts"></div></div></div></script>function onDetailInit(e) { var detailRow = e.detailRow; detailRow.find(".tabstrip").kendoTabStrip({ animation: {open: {effects: "fadeIn"}} }); detailRow.find(".addresses").kendoGrid({ dataSource: DataSource.get("address"), serverPaging: true, serverSorting: true, serverFiltering: true, scrollable: false, sortable: true, pageable: true, columns: [ {field: "street_address", title:"Anschrift"}, {field: "zip", title: "PLZ"}, {field: "city", title: "Ort"} ] }); detailRow.find(".addresses").data("kendoGrid").dataSource.filter( [{ field: "id", operator: "eq", value: e.data.id }] ) detailRow.find(".contacts").kendoGrid({ dataSource: DataSource.get("contact"), serverPaging: true, serverSorting: true, serverFiltering: true, scrollable: false, sortable: true, pageable: true, columns: [ {field: "surname", title:"Nachname"}, {field: "prename", title: "Vorname"}, {field: "phone", title: "Telefon"}, {field: "mail", title: "Email"}, {field: "birthday", title: "Geburtsdatum", template: '#= kendo.toString(birthday, "dd.MM.yyyy")#'} ] }); detailRow.find(".contacts").data("kendoGrid").dataSource.filter( [{ field: "client_id", operator: "eq", value: e.data.id }] )}