Hi,
I have to get the values user entered on edit in the inline grid. So I have kept save event on gird and trying to access the values on the method but I am not sure how to the get the values.
@(Html.Kendo().Grid<
BHEBS.Areas.Admin.Models.ContractBudgetModel.contractBudgetBUModel
>()
.Name("ContractBudgetBUGrid")
.Events(e => e.Save("onSave"))
.Columns(columns =>
{
columns.Bound(p => p.Id);
columns.Bound(p => p.BusinessUnit);
columns.Bound(p => p.Description);
columns.Bound(p => p.ServiceType);
columns.Bound(p => p.BUAuthAmt);
columns.ForeignKey(p => p.SpendPriority, (System.Collections.IEnumerable)ViewData["SpendPriority"], "Value", "Text").Width(120);
columns.Bound(p => p.ContractBUAmt);
columns.Bound(p => p.BUBudgetAmt);
columns.ForeignKey(p => p.contractSpendPriority, (System.Collections.IEnumerable)ViewData["SpendPriority"], "Value", "Text").Width(120);
columns.Command(command =>
{
command.Edit().HtmlAttributes(new { @class = "btn-primary" });
});
})
.Pageable(pageable => pageable.Refresh(true).PageSizes(true).ButtonCount(5))
.Sortable()
.Scrollable()
.Filterable()
.Selectable()
.Resizable(resize => resize.Columns(true))
.HtmlAttributes(new { style = "height:450px;" })
.DataSource(dataSource => dataSource.Ajax().PageSize(10).Read(read => read.Action("ContractBudgetBU_Read", "ContractBudget").Data("additionalInfo"))
.Model(model => { model.Id(p => p.Id); model.Field(p => p.Id).Editable(false); model.Field(p => p.BusinessUnit).Editable(false); model.Field(p => p.Description).Editable(false); model.Field(p => p.ServiceType).Editable(false); model.Field(p => p.BUAuthAmt).Editable(false); model.Field(p => p.BUBudgetAmt).Editable(false); model.Field(p => p.SpendPriority).Editable(false); model.Field(p => p.contractSpendPriority).DefaultValue("Normal"); })
.Update(update => update.Action("Update_ContractBudgetBU", "ContractBudget"))))
function onSave(e) {
var data = e.values;
//I am getting error e.values is undefined.
}
Thanks,
Veena