<ej-button id="button_button" click="Refresh" type="Button" text="click" />
<ej-grid id="grid" allow-paging="true" action-complete="onActionComplete">
<e-datamanager url="/Home/AdrTypDataAll" adaptor="UrlAdaptor" />
. . .
. . .
</ej-grid>
<script>
function Refresh() {
//button click sent the POST for modification
$.ajax({
type: "POST",
url: "/Home/GetData",
success: function (data) {
var gridObj = $("#grid").ejGrid("instance");
//refreshed the Grid.
gridObj.refreshContent();
},
});
}
function onActionComplete(args) {
var gridObj = $("#grid").ejGrid("instance");
//Complete action shows the current set of Records with modification
console.log(gridObj.getCurrentViewData()[0].CustomerID);
}
</script>
public ActionResult GetData()//POST method for Button Click
{
IEnumerable DataSource = order;
order[0].CustomerID = "VINET";//update the record manually
return Json("success");
} |
Hi Seeni:I tested your sample, but I did an small change to reproduce my problem:public ActionResult GetData(){IEnumerable DataSource = order;// order[0].CustomerID = "VINET";var id = "YYYYY";order = order.Where(o => o.CustomerID == id).ToList();return Json("success");}You will see that the grid shows the correct data, but the following line is not retrieving the correct data:var data = gridObj.getCurrentViewData();Based on the customer Id "YYYYY" that I provided, the console.log should display an empty string, but instead is printing out the value of ALFKI.Best Regards,David