$.ajax({
...
success: function (result) {
...
var grid = new ej.grids.Grid({
dataSource: result.listaBeneficiarios,
...
locale: "es-CO",
load: function (args) {
console.log("Need to define the load event handler");
}
});
grid.appendTo("#grdBeneficiarios");
},
...
});
|
<div id="Grid"></div>
<script>
var data = @Html.Raw(Json.Serialize(ViewBag.DataSource));
var dataSource = new ej.data.DataManager({
json: data,
adaptor: new ej.data.RemoteSaveAdaptor(),
insertUrl: '/Home/Insert',
updateUrl: '/Home/Update',
removeUrl: '/Home/Delete'
});
var grid = new ej.grids.Grid({
dataSource: dataSource,
...
});
grid.appendTo("#Grid");
</script>
|