or
$(e.form).find(".t-grid-cancel").click(function () { if (e.mode == "insert") { //do insert cancel cleanup code }});
3. What is the Kendo equivalent of this:
$(e.form).find(".t-grid").data("tGrid").ajaxRequest({ InventoryItemId: key });
3. In the Save client event, what would be the equivalent of this code for Kendo?
e.values.inventoryItemId = key;I think that is enough to start with..
Thanks in advance for any help!
@(Html.Kendo().EditorFor(model => model.Message.MessageText) .Name("Message.MessageText") .HtmlAttributes(new { style = "height:550px" }) .Tools(tools => tools .Clear() .Bold() .Italic() .Underline() .Strikethrough() .FontColor() .BackColor() .InsertOrderedList() .InsertUnorderedList() .Indent() .Outdent() .CreateLink() .Unlink() ) )
@(Html.Kendo().Grid<BillHeader>() .Name("BillHeaders") .Columns(columns => { columns.Bound(h => h.BillHeaderId); columns.Bound(h => h.Category); columns.Bound(h => h.Description); columns.Bound(h => h.Amount); }) .Pageable() .Selectable(selectable => selectable .Mode(GridSelectionMode.Multiple) .Type(GridSelectionType.Row)) .DataSource(dataSource => dataSource .Ajax() .PageSize(6) .Events(events => events.Error("error_handler")) .Read(read => read.Action("BillHeaders_Read", "Bill")) ) .Events(events => events.DataBound("dataBound")) .ClientDetailTemplateId("BillDetails") )<script id="BillDetails" type="text/kendo-tmpl"> @(Html.Kendo().Grid<BillDetail>() .Name("BillDetails_#=BillHeaderId#") .Columns(columns => { columns.Bound(d => d.BillHeaderId).Width(50); columns.Bound(d => d.BillDetailId).Width(70); columns.Bound(d => d.Category).Width(70); columns.Bound(d => d.Description).Width(150); columns.Bound(d => d.Amount).Width(80); columns.Command(command => { command.Edit(); command.Destroy(); }).Width(75); }) .DataSource(dataSource => dataSource .Ajax() .PageSize(10) .Model(model => { model.Id(d => d.BillDetailId); model.Field(d => d.BillDetailId).Editable(false); }) .Events(events => events.Error("error_handler")) .Read(read => read.Action("BillDetails_Read", "Bill", new { billHeaderId = "#=BillHeaderId#" })) .Update(update => update.Action("BillDetail_Update", "Bill")) .Create(create => create.Action("BillDetail_Create", "Bill", new { billHeaderId = "#=BillHeaderId#" })) .Destroy(destroy => destroy.Action("BillDetail_Destroy", "Bill"))) .Pageable() .ToolBar(tools => tools.Create()) .ToClientTemplate() )</script>[AcceptVerbs(HttpVerbs.Post)] public ActionResult BillDetail_Create(BillDetail billDetail, int billHeaderId) { if (billHeaderId == 0) { ModelState.AddModelError("billHeaderID", "add bill header first"); } if (billDetail != null && ModelState.IsValid) { var target = new BillDetail { Category = billDetail.Category, Description = billDetail.Description, Amount = billDetail.Amount, BillHeaderId = billHeaderId, BillDetailId = SessionBillDetails.Max(d => d.BillDetailId) + 1 }; //Get next Id in sequence billDetail.BillDetailId = target.BillDetailId; SessionBillDetails.Add(target); } return Json(new[] { billDetail }.ToDataSourceResult(new DataSourceRequest(), ModelState)); }
.DataSource(dataSource=>dataSource .Ajax() .PageSize(20) .Model(m=> { m.Id(p => p.LogID); }) .Read(read=>read.Action("GetCRISList","NonDALoads") .Data("srchLoad") ) ) .Pageable(p=>p.Refresh(true)) .Sortable() .Filterable() <script type="text/javascript"> var srch = 28; function selectionChange() { var dropdownlist = $("#loadDDL").data("kendoDropDownList"); var dataItem = dropdownlist.dataItem(); srch = dataItem.LoadID; //refresh Grid //$("#Grid").data("kendoGrid").dataSource.read(); $('#Grid').data().kendoGrid.dataSource.page(1); } function srchLoad() { return { ID: srch }; } </script>
$('#BookingGrid').data().kendoScheduler.resources[0].dataSource.read()