or
var dataSource = new kendo.data.DataSource({ type: "odata", serverPaging: true, serverSorting: true, serverFiltering: true, pageSize: 20, batch: false, schema: { model: { id: "No_", fields: { No_: { type: "string" }, Customer_WR_Code: { type: "string" }, Description: { type: "string" }, State: { type: "string" }, Creation_Date: { type: "date" }, Creation_Time: { type: "date" }, Closing_Date: { type: "date" }, Closing_Time: { type: "date" }, Cancelling_Date: { type: "date" }, Cancelling_Time: { type: "date" }, Expiry_Date: { type: "date" }, Appointment_Begin_Date: { type: "date" }, Appointment_Begin_Time: { type: "date" }, Appointment_End_Time: { type: "date" }, Appointment_End_Date: { type: "date" }, DateTime_Field_1: { type: "date" }, DateTime_Field_2: { type: "date" }, Date_Field_1: {type:"date"}, Date_Field_2: {type:"date"} } } }, transport: { read: "WCFDB.svc/View_Work_Request", update: { url: "WCFDB.svc/View_Work_Request", type: "POST", dataType: "json" } }});$("#grid").kendoGrid({ dataSource: dataSource, height: 550, pageable: { refresh: true, pageSizes: true }, reorderable: true, editable: "inline", sortable: true, filterable: true, columnMenu: true, navigatable: false, resizable: true, toolbar: kendo.template($("#tmplToolBar").html()), change: function (e) { var grid = $("#grid").data("kendoGrid"); var model = grid.dataItem(grid.select()); refreshTab(model); }, dataBound: function (e) { var item = e.sender.dataSource.at(0); refreshTab(item); }, selectable: "row", columns: kendoGridColumns });[JSONPSupportBehavior] public class WCFDB : DataService<WOMContainer> { // Questo metodo viene chiamato solo una volta per inizializzare i criteri a livello di servizio. public static void InitializeService(DataServiceConfiguration config) { // TODO: impostare regole per indicare i set di entità e le operazioni del servizio visibili, aggiornabili e così via. // Esempi: config.SetEntitySetPageSize("*", 20); config.SetEntitySetAccessRule("*", EntitySetRights.All); config.SetServiceOperationAccessRule("*", ServiceOperationRights.All); config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2; config.UseVerboseErrors = true; } ................................ ................................ ................................ ................................| <script> | |
| jQuery(function () { | |
| shoppingLists_datasource = new kendo.data.DataSource({ | |
| pageSize:4, | |
| schema:{ | |
| model: { | |
| id: 'familyShoppingList_id', | |
| fields: { | |
| familyShoppingList_id: { editable: false, nullable: true }, | |
| shoppingList_main: { editable: true}, | |
| shoppingList_date: { editable: true} | |
| } | |
| } | |
| }, | |
| transport:{ | |
| read:{ | |
| url:'/apps/wpd/apps/shopping/index.cfc?method=getShoppingLists', | |
| dataType: 'json' | |
| }, | |
| create:{ | |
| url:'/apps/wpd/apps/shopping/index.cfc?method=saveShoppingList', | |
| dataType: 'json' | |
| }, | |
| update:{ | |
| url:'/apps/wpd/apps/shopping/index.cfc?method=saveShoppingList', | |
| dataType: 'json' | |
| }, | |
| destroy:{ | |
| url:'/apps/wpd/apps/shopping/index.cfc?method=removeShoppingList', | |
| dataType: 'json' | |
| } | |
| } | |
| }) | |
| }) | |
| </script> | |
| <script> | |
| var shoppingLists_listView; | |
| jQuery(function () { | |
| shoppingLists_listView = jQuery("#shoppingLists").kendoListView({ | |
| dataSource: shoppingLists_datasource, | |
| template: kendo.template($("#viewTemplate").html()), | |
| editTemplate: kendo.template($("#editTemplate").html()) | |
| }) | |
| .delegate(".k-edit-button", "click", function(e) { | |
| shoppingLists_listView.edit($(this).closest(".list-view")); | |
| e.preventDefault(); | |
| }) | |
| .delegate(".k-delete-button", "click", confirmDel) | |
| .delegate(".k-update-button", "click", function(e) { | |
| shoppingLists_listView.save(); | |
| e.preventDefault(); | |
| }) | |
| .delegate(".k-cancel-button", "click", function(e) { | |
| shoppingLists_listView.cancel(); | |
| e.preventDefault(); | |
| }) | |
| .data("kendoListView") | |
| }) | |
| </script> |
@(Html.Kendo().Grid(Model) .Name("AllTickets") .DataSource(ds => ds.Server().Model(m => m.Id(t => t.ID))) .ToolBar(toolbar => toolbar.Template( @<text> Site: @(Html.Kendo().DropDownList() .Name("SiteFilter") .DataTextField("SiteName") .DataValueField("ID") .OptionLabel("Any") .DataSource(dataSource => dataSource.Read("GetSitesForView", "Home")) .Events(events => events.Change("change")) ) </text> )) .Columns(cols => { cols.Bound(t => t.ID).Title("ID").Title("Ticket ID").Filterable(true).Width(50); cols.Bound(t => t.Site).Title("Site").Filterable(true); cols.Bound(t => t.DhrNumber).Title("DHR Number").Filterable(true).Width(100); cols.Bound(t => t.Room).Title("Room").Filterable(true); cols.Bound(t => t.ShortSummary).Title("Ticket Description").Filterable(true); cols.Bound(t => t.Status).Title("Ticket Status").Filterable(true).Width(80); }) )
<div id="menu"></div><p><br/><br/><br/><br/></p><ul id="menu-2"></ul><script> $(function() { var m = $('#menu, #menu-2').kendoMenu({ dataSource: [ { text: "Baseball", imageUrl: "../../content/shared/icons/sports/baseball.png", items: [ { text: "Top News", imageUrl: "../../content/shared/icons/16/star.png" }, { text: "Photo Galleries", imageUrl: "../../content/shared/icons/16/photo.png" }, { text: "Videos Records", imageUrl: "../../content/shared/icons/16/video.png" }, { text: "Radio Records", imageUrl: "../../content/shared/icons/16/speaker.png" } ] }, { text: "Golf", imageUrl: "../../content/shared/icons/sports/golf.png", items: [ { text: "Top News", imageUrl: "../../content/shared/icons/16/star.png" }, { text: "Photo Galleries", imageUrl: "../../content/shared/icons/16/photo.png" }, { text: "Videos Records", imageUrl: "../../content/shared/icons/16/video.png" }, { text: "Radio Records", imageUrl: "../../content/shared/icons/16/speaker.png" } ] }, { text: "Swimming", imageUrl: "../../content/shared/icons/sports/swimming.png", items: [ { text: "Top News", imageUrl: "../../content/shared/icons/16/star.png" }, { text: "Photo Galleries", imageUrl: "../../content/shared/icons/16/photo.png" } ] }, { text: "Snowboarding", imageUrl: "../../content/shared/icons/sports/snowboarding.png", items: [ { text: "Photo Galleries", imageUrl: "../../content/shared/icons/16/photo.png" }, { text: "Videos Records", imageUrl: "../../content/shared/icons/16/video.png" } ] } ], orientation: 'vertical' }); });</script><style> #menu-2 { width: 300px; }</style>ul.k-menu-vertical > .k-item{ display: block; float: none; border-width: 0;}