| @(Html.EJ().Grid<object>("gridPP") .Datasource((IEnumerable<object>)ViewBag.dsPolicaPP) . . . . . . }).ClientSideEvents(eve => eve.ActionComplete("actionComplete").ActionBegin("begin")) ) </div> <script type="text/javascript"> var ddldata = @Html.Raw(Json.Encode(ViewBag.ddldata)) function actionComplete(args) { //while editing the grid . . . . . . } } function begin(args){ if (args.requestType == "save") { var Obj = $("#gridPP").ejGrid("instance"); Obj.model.columns[1].dataSource = ddldata; } } </script> |
Hi Bernard,
Query 1: Potproizvod is not selected,
In your case we have updated the dropdownlist value by using ajax action in the actionComplete event. So, while editing begins the datasource becomes null. Due to this, while editing the Potproizvod is not selected.
Query 2: The Premija column value is 2, but I saved 1.
We are unable to reproduce the reported issue. Please refer the attached link for video demo and sample.
Regards,
Manivannan Padmanaban.
| col.Field("OrderID").HeaderText("PolicaProPodID").IsPrimaryKey(true).Visible(false).TextAlign(TextAlign.Right).Width(75).Add(); |
| function begin(args) { if (args.requestType == "save") { args.rowData.OrderID = Math.random() // pass random value to primarycolumn while saving var Obj = $("#gridPP").ejGrid("instance"); Obj.model.columns[1].dataSource = ddldata; } } |