Please reply to: v-daughw-oxf@ae.com
I cannot get the requestEnd event to fire at all with Kendo MVC build 2013.1.319.340 . WHY???????
< script>
//can't get this to fire to display success/fail msg
function onRequestEnd(e) {
debugger
//Check request type
if (e.type == "create" || e.type == "update") {
//check for errors in the response
if (e.response == null || e.response.Errors == null) {
$('#PivotGrid').data().kendoGrid.dataSource.read();
alert("Update Successful");
}
else {
alert("Update Failed");
}
}
}
< /script>
< div align="center">
@(Html.Kendo().Grid<PivotRow>()
.Name("PivotGrid")
.HtmlAttributes(new { align = "center", style = "height:600px; width:75%" })
.Scrollable()
.Sortable()
.Navigatable()
.Columns(columns =>
{
columns.Bound(c => c.us_price).Width(90).Title("US Price");
columns.Bound(c => c.us_base_pricepoint).Width(90).Title("US Base Price").Hidden();
columns.Bound(c => c.canada_price).Width(90).Title("Canada Price");
columns.Bound(c => c.mexico_price).Width(90).Title("Mexico Price");
columns.Bound(c => c.what_system).Width(100).Title("What System").Hidden();
//columns.Bound(c => c.what_system).Width(90).EditorTemplateName("_DDL_BM");
columns.Command(command => command.Destroy()).Width(50);
})
.Editable(editing => editing.Mode(GridEditMode.InCell))
// Command configuration
.ToolBar(toolbar =>
{
toolbar.Create();
toolbar.Save();
})
.Events(e => e.SaveChanges("saveChanges"))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
// Specify property that is the unique identifier of the model
.Model(model => model.Id(c => c.us_base_pricepoint))
.Model(model =>
{
model.Field(c => c.what_system).DefaultValue("BM");
})
.Events(events =>
{
events.RequestEnd("onRequestEnd"); //can't get this to fire!
events.Error("error");
})
.Create(create => create.Action("PricePoint_Create", "AE_IB_LOOKUP_VAL"))
.Read(read => read.Action("PricePoint_Read", "AE_IB_LOOKUP_VAL"))
.Update(update => update.Action("PricePoint_Update", "AE_IB_LOOKUP_VAL"))
.Destroy(destroy => destroy.Action("PricePoint_Destroy", "AE_IB_LOOKUP_VAL"))
)
)
I cannot get the requestEnd event to fire at all with Kendo MVC build 2013.1.319.340 . WHY???????
< script>
//can't get this to fire to display success/fail msg
function onRequestEnd(e) {
debugger
//Check request type
if (e.type == "create" || e.type == "update") {
//check for errors in the response
if (e.response == null || e.response.Errors == null) {
$('#PivotGrid').data().kendoGrid.dataSource.read();
alert("Update Successful");
}
else {
alert("Update Failed");
}
}
}
< /script>
< div align="center">
@(Html.Kendo().Grid<PivotRow>()
.Name("PivotGrid")
.HtmlAttributes(new { align = "center", style = "height:600px; width:75%" })
.Scrollable()
.Sortable()
.Navigatable()
.Columns(columns =>
{
columns.Bound(c => c.us_price).Width(90).Title("US Price");
columns.Bound(c => c.us_base_pricepoint).Width(90).Title("US Base Price").Hidden();
columns.Bound(c => c.canada_price).Width(90).Title("Canada Price");
columns.Bound(c => c.mexico_price).Width(90).Title("Mexico Price");
columns.Bound(c => c.what_system).Width(100).Title("What System").Hidden();
//columns.Bound(c => c.what_system).Width(90).EditorTemplateName("_DDL_BM");
columns.Command(command => command.Destroy()).Width(50);
})
.Editable(editing => editing.Mode(GridEditMode.InCell))
// Command configuration
.ToolBar(toolbar =>
{
toolbar.Create();
toolbar.Save();
})
.Events(e => e.SaveChanges("saveChanges"))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
// Specify property that is the unique identifier of the model
.Model(model => model.Id(c => c.us_base_pricepoint))
.Model(model =>
{
model.Field(c => c.what_system).DefaultValue("BM");
})
.Events(events =>
{
events.RequestEnd("onRequestEnd"); //can't get this to fire!
events.Error("error");
})
.Create(create => create.Action("PricePoint_Create", "AE_IB_LOOKUP_VAL"))
.Read(read => read.Action("PricePoint_Read", "AE_IB_LOOKUP_VAL"))
.Update(update => update.Action("PricePoint_Update", "AE_IB_LOOKUP_VAL"))
.Destroy(destroy => destroy.Action("PricePoint_Destroy", "AE_IB_LOOKUP_VAL"))
)
)