I have a Kendo grid with inline editing. It works great. An issue I have right now is that after an inline update of a record, if certain conditions of the update exist I need to redirect to another Page i.e. RedirectToAction. So the code looks like:
This code works as designed but will not display the page. This of course is due to the AJAX call which is returning to the datasource.
Several things happen on the line order = UpdateOrder(order); This method is in the Controller and sets several fields in the record that was updated including the orderStatus. The repository.UpdateOrder(order) happens in the SessionOrderRepository class.
Since the fields in the UpdateOrder method of the Controller are not set by the user, the information is not updated in the grid either (grid updates immediately). And if for some reason the orderStatus is placed in the "HD" (hold) state we want to redirect the user to a page that displays the reason(s) that the order is on hold. Clicking Ok on that page would redirect them to the grid and all of the fields would be updated since it has to reload.
Technically this is probably not a Kendo issue but if anyone has a work around on this your help would be greatly appreciated.
Regards,
Paul
public
ActionResult EditingInline_Update([DataSourceRequest] DataSourceRequest request, OrderViewModel order)
{
if
(order !=
null
&& ModelState.IsValid)
{
order = UpdateOrder(order);
repository.UpdateOrder(order);
}
if
(order.orderStatus ==
"HD"
)
return
RedirectToAction(
"Info"
);
return
Json(ModelState.ToDataSourceResult());
}
This code works as designed but will not display the page. This of course is due to the AJAX call which is returning to the datasource.
Several things happen on the line order = UpdateOrder(order); This method is in the Controller and sets several fields in the record that was updated including the orderStatus. The repository.UpdateOrder(order) happens in the SessionOrderRepository class.
Since the fields in the UpdateOrder method of the Controller are not set by the user, the information is not updated in the grid either (grid updates immediately). And if for some reason the orderStatus is placed in the "HD" (hold) state we want to redirect the user to a page that displays the reason(s) that the order is on hold. Clicking Ok on that page would redirect them to the grid and all of the fields would be updated since it has to reload.
Technically this is probably not a Kendo issue but if anyone has a work around on this your help would be greatly appreciated.
Regards,
Paul