or
var members = [{ Ime: "John", Priimek: "Novak", KrajRojstva: "London", DatumRojstva: new Date(1987, 4, 19) }]; var memberDataSource = new kendo.data.DataSource({ pageSize: 30, data: members, autoSync: true, schema: { model: { fields: { Ime: { editable: true }, Priimek: { editable: true }, KrajRojstva: { editable: true }, DatumRojstva: { editable: true, type: "date" } } } } }); $("#reservationGrid").kendoGrid({ dataSource: dataSource, groupable: true, sortable: true, pageable: { refresh: true, pageSizes: true }, columns: [ { field: "Location", width: 70, title: "Lokacija" }, { field: "Unit", width: 70, title: "Enota" }, { field: "Capacity", width: 40, title: "Osebe" }, { field: "From", width: 60, title: "Od" , type:"date" , template: "#=kendo.toString(From, 'd.M.yyyy') #" ,format:"d.M.yyyy" }, { field: "To", width: 60, title: "Do" , type:"date" , template: "#=kendo.toString(To, 'd.M.yyyy') #" ,format:"d.M.yyyy" }, { command: { text: "Rezerviraj", click: showDetails }, title: " ", width: "50px" } ], editable:true }); wnd = $("#detail-container") .kendoWindow({ title: "Podrobnosti o rezervaciji", modal: true, visible: false, resizable: false, actions: ["close"], width: 750, height: 500 }).data("kendoWindow"); function showDetails(e) { e.preventDefault(); var dataItem = this.dataItem($(e.currentTarget).closest("tr")); detailsTemplate = kendo.template($("#reservationDetail").html()); wnd.content(detailsTemplate(dataItem)); wnd.center().open(); $("#membersGrid").kendoGrid({ dataSource: memberDataSource, sortable: true, toolbar: ["create"], columns: [ { field: "Ime", width: 50, title: "Ime" }, { field: "Priimek", width: 50, title: "Priimek" }, { field: "KrajRojstva", width: 50, title: "Kraj Rojstva" }, { field: "DatumRojstva", width: 60, title: "Datum Rojstva", type: "date", template: "#=kendo.toString(DatumRojstva, 'd.M.yyyy') #", format: "d.M.yyyy" }, { command: {name: "destroy", text:"zbrisi"} , width: "50px" } ], editable: true }); wnd.center(); }<div id="reservationGrid" class="kendo-grid"></div> <div id="detail-container" ></div><script type="text/x-kendo-tmpl" id="reservationDetail">
<div id="top-wrapper"><div id="table" class="reservationDetail-table"> <table width:"300px"> <tr> <td>Location: <div class="reservationDetail-property">#= Location #</div></td> <td>Unit: <div class="reservationDetail-property">#= Unit #</div></td> </tr> <tr> <td>Od: <div class="reservationDetail-property">#= kendo.toString(From, "d.M.yyyy") #</div>
</td> <td>Do: <div class="reservationDetail-property">#= kendo.toString(To, "d.M.yyyy") #</div>
</td>
</tr> </table> </div>
<div id="button-confirmReservation"> <a class="k-button k-button-icontext " href="\\#"><span class="k-icon k-update"> </span>Confirm</a> </div> </div>
<div id="membersGrid" class="kendo-gridMembers"></div> </script>using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.ComponentModel.DataAnnotations;namespace G4.Models{ public class myModel { [Display(Name="Name")] [Required(ErrorMessage="The field Name is required")] public string name { get; set; } [Display(Name = "Birth Date")] [Required(ErrorMessage = "The field Birth Date is required")] [DataType(DataType.Date, ErrorMessage="Wrong format !!!!")] public DateTime bDate { get; set; } }}public ActionResult myView() { G4.Models.myModel model = new G4.Models.myModel(); return View(model); }<!DOCTYPE html><html><head> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> @Styles.Render("~/Content/css") @Styles.Render("~/Content/kendo/css") <script src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")"></script> <script src="@Url.Content("~/Scripts/jquery-ui-1.9.2.custom.min.js")"></script> <script src="@Url.Content("~/Scripts/modernizr-2.5.3.js")"></script> <script src="@Url.Content("~/Scripts/kendo.web.min.js")"></script> <script src="@Url.Content("~/Scripts/kendo.aspnetmvc.min.js")"></script> <script src="@Url.Content("~/Scripts/kendo.validator.min.js")"></script> <script src="@Url.Content("~/Scripts/cultures/kendo.culture.it-IT.min.js")"></script> <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")"></script> <script src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script></head><body> <div> @RenderBody() </div></body></html>@model G4.Models.myModel@{ ViewBag.Title = "myView"; Layout = "~/Views/Shared/_myLayout.cshtml";}<h2> myView</h2>@using (Html.BeginForm()){ @Html.LabelFor(m => m.name)<br /> @Html.EditorFor(m => m.name) <br /><br /> @Html.LabelFor(m => m.bDate)<br /> @Html.EditorFor(m => m.bDate) @Html.ValidationMessageFor(m => m.bDate)})@model DateTime?@(Html.Kendo().DatePickerFor(m => m).Format("dd/MM/yyyy")) @(Html.Kendo().Grid<CMS_2013.Models.CMS_SSIS_Package>().Name("Grid").Events(e=>e.Edit("onEdit")).Columns(columns=> {columns.Bound(p=>p.PackageID).Title("ID"); columns.Bound(p => p.UniqueName).Title("Name"); columns.Bound(p => p.PackageName).Title("Value"); columns.Bound(p => p.PackageDescription).Title("Description"); columns.Command(command => { command.Edit(); command.Destroy(); }); }) .ClientDetailTemplateId("configTemplate") .ToolBar(commands=>commands.Create()) .Editable(editable=>editable .Mode(GridEditMode.PopUp)) .DataSource(dataSource=>dataSource .Ajax() .Model(m=>m.Id(p=>p.PackageID)) .Events(events => events.Error("error")) .PageSize(10) .Read(read=>read.Action("ReadPackages","Settings")) .Create(create=>create.Action("InsertPackage","Settings")) .Update(update=>update.Action("UpdatePackage","Settings")) .Destroy(delete=>delete.Action("DeletePackage","Settings")) ) .Pageable() .Sortable() .Filterable() ) </div><script id="configTemplate" type="text/kendo-tmpl"> @(Html.Kendo().Grid<CMS_2013.Models.CMS_SSIS_Package_Config>() .Name("Configs_#=PackageID#") .Events(e=>e.Edit("onEdit2")) .Columns(columns => { columns.Bound(o => o.ConfigName); columns.Bound(o => o.ConfigFile); columns.Command(command => { command.Edit(); command.Destroy(); }); }) .ToolBar(commands=>commands.Create()) .Editable(editable=>editable .Mode(GridEditMode.PopUp)) .DataSource(dataSource => dataSource .Ajax() .Model(m=>m.Id(p=>p.ConfigID)) .Read(read => read.Action("ReadConfigs", "Settings", new { PackageID = "#=PackageID#" })) .Create(create=>create.Action("InsertConfig","Settings", new { PackageID = "#=PackageID#" })) .Update(update=>update.Action("UpdateConfig","Settings")) .Destroy(delete=>delete.Action("DeleteConfig","Settings")) ) .Pageable() .Sortable() .ToClientTemplate() )</script>[AcceptVerbs(HttpVerbs.Post)] public ActionResult InsertConfig([DataSourceRequest] DataSourceRequest request, Models.CMS_SSIS_Package_Config config, int PackageID) { config.PackageID = PackageID; _repository.InsertConfig(config); return Json(new[] { config }.ToDataSourceResult(request, ModelState)); }http://localhost:51898/Settings/InsertConfig?PackageID=2@using Kendo.Mvc.UI@using Mvc.Models@model IEnumerable<ConciergeModel>@{ ViewBag.Title = "Manage Live-Connect Concierge List"; Layout = "~/Views/Shared/_Kendo.cshtml";}<h2>@ViewBag.Title</h2><h3>Server Side Initialization</h3>@{ try { @(Html.Kendo().Grid(Model) .Name("Concierge") .Columns(columns => { columns.Bound(c => c.ConciergeId).Groupable(false).Width(40); columns.Bound(c => c.ConciergeName).Width(240); columns.Bound(c => c.ConciergeEmail).Width(480); columns.Command(command => command.Edit()); }) .ToolBar(toolbar => { toolbar.Create(); }) .Editable(editable => editable.Mode(GridEditMode.Inline)) .Pageable() .Sortable() .Scrollable() .DataSource( dataSource => dataSource .Ajax() .Model(model => model.Id(c => c.ConciergeId)) .Create(create => create.Action("ConciergeCreate", "Concierge")) .Read(read => read.Action("ConciergeRead", "Concierge")) .Update(update => update.Action("ConciergeUpdate", "Concierge")) )) } catch(Exception e) { @Html.Raw("<pre>" + e + "</pre>"); }}using System.ComponentModel;using System.ComponentModel.DataAnnotations;namespace Mvc.Models{ public class ConciergeModel { public ConciergeModel() { } [Required] [DisplayName("ID")] public long ConciergeId { get; set; } [Required] [DisplayName("Name")] [DataType(DataType.Text)] public string ConciergeName { get; set; } [Required] [DisplayName("Email Address")] [DataType(DataType.EmailAddress)] public string ConciergeEmail { get; set; } }}// POST: /mvc/{admin-id}/Concierge/ConciergeUpdate[AcceptVerbs(HttpVerbs.Post)]public JsonResult ConciergeUpdate([DataSourceRequest] DataSourceRequest request, ConciergeModel concierge){ if (concierge != null && ModelState.IsValid) { // At this point, concierge.ConciergeId is zero concierge.Update(_lccConciergeService); } return Json(new[] { concierge }.ToDataSourceResult(request, ModelState));}| Cache-Control | private |
| Content-Length | 0 |
| Date | Sun, 23 Dec 2012 23:19:15 GMT |
| Persistent-Auth | true |
| Server | Microsoft-IIS/8.0 |
| X-AspNet-Version | 4.0.30319 |
| X-AspNetMvc-Version | 3.0 |
| X-Powered-By | ASP.NET |
| X-SourceFiles | =?UTF-8?B?QzpcTGVhZE1hc3RlclxMYXRlc3RccGxhdGZvcm1cTGVhZE1hc3RlclBsYXRmb3JtXEF3bC5MZWFkTWFzdGVyLk12Y1wxMjNcQ29uY2llcmdlc1xDb25jaWVyZ2VVcGRhdGU=?= |
| Accept | */* |
| Accept-Encoding | gzip, deflate |
| Accept-Language | en-US,en;q=0.5 |
| Cache-Control | no-cache |
| Connection | keep-alive |
| Content-Length | 110 |
| Content-Type | application/x-www-form-urlencoded; charset=UTF-8 |
| Cookie | ASP.NET_SessionId=4ff34okn0jkkwqi3k0qswb4l |
| Host | localhost:7171 |
| Pragma | no-cache |
| Referer | http://localhost:7171/mvc/123/Concierges/ |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0 |
| X-Requested-With | XMLHttpRequest |
|
Parametersapplication/x-www-form-urlencoded
|
|
| ConciergeEmail | jimbob@allwebleadstransferportal.com |
| ConciergeId | 2 |
| ConciergeName | Jim Bob |
| filter | |
| group | |
| sort | |
|
Source
|
|
sort=&group=&filter=&ConciergeId=2&ConciergeName=Jim+Bob&ConciergeEmail=jimbob%40allwebleadstransferportal.com |
@(Html.Kendo().TreeView().Name("treeview") .AutoBind(true) .LoadOnDemand(true) .DataTextField("Name") .DataSource(dataSource => dataSource .Read(read => read .Action("GetNameList", "Home")) .Events(e => e.RequestEnd("onRequestEnd")) ))<script> var treeview; $(document).ready(function () { treeview = $("#treeview").data("kendoTreeView"); }); function onRequestEnd() { treeview.select(".k-first"); }</script><tr> <td valign="top" colspan="2"> <div style="float: left"> <em>*</em> @Html.LabelFor(model => model.CountryId) <br /> @Html.Kendo().DropDownListFor(model => model.CountryId).BindTo(Model.AvailableCountries).Animation(true).HtmlAttributes(new { onchange = "populateState(this)", style = "width:250px;" }) <span id="states-loading-progress" style="display: none;">Wait... <img src='@Url.Content("~/Content/Images/ajax_loader_small.gif")' alt="Wait..." /> </span> </div> <div style="float: right"> @Html.LabelFor(model => model.PostalCode) <br /> @Html.TextBoxFor(model => model.PostalCode, new { @class = "k-textbox", style = "width:100px;" }) </div> </td> </tr> <tr> <td valign="top">@Html.LabelFor(model => model.State) <br /> <div id="ddlStates"> @(Html.Kendo().DropDownList() .Name("State") // .OptionLabel("Select state...") .DataTextField("name") .DataValueField("id") .DataSource(source => { source.Read(read => { read.Route("GetStatesByCountryId") .Data("CountryId") .Type(HttpVerbs.Post); // This line serves to accept POST requests }) .ServerFiltering(true); }) .Enable(false) .AutoBind(false) .CascadeFrom("CountryId") )