Hi, I'm instantiating an editable grid via the MVC wrappers (example code below). What I want to do is respond to a change in the Amount (or other fields) with some custom client-side logic that will update the total (Amount * Unit Price = Total).
What's the best way to set this up? Do I need an editor template or something? Can someone point me to an example?
What's the best way to set this up? Do I need an editor template or something? Can someone point me to an example?
@(Html.Kendo().Grid<
MaterialEstimateQuantityApplicationModel
>()
.Name("MaaterialEstimateQuantityApplicationGrid")
.Columns(columns =>
{
columns.Bound(p => p.Amount);
columns.Bound(p => p.QuantityAmount);
columns.Bound(p => p.MaterialMarkup);
columns.Bound(p => p.UnitPrice);
columns.Bound(p => p.Total);
columns.Bound(p => p.MaterialEstimationId).Visible(false);
columns.Bound(p => p.ItemQuantityId).Visible(false);
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
//.Pageable()
.Navigatable()
//.Sortable()
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.PageSize(20)
.ServerOperation(false)
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.Id))
.Read("EditingLaborItemsCreate_Read", "Estimate", new { estimateId = Model.EstimateId })
.Update("EditingLaborItemsCreate_Update", "Estimate")
.Create("EditingLaborItemsCreate_Create", "Estimate")
).