(Html.EJ().Grid<object>("Grid")
.Datasource(ds => ds.URL("UrlDataSource").UpdateURL("UrlUpdate").InsertURL("UrlInsert").RemoveURL("UrlDelete")
.Adaptor(AdaptorType.UrlAdaptor))
.AllowPaging()
.AllowFiltering()
.AllowGrouping()
.AllowSorting()
.AllowSearching()
.ClientSideEvents(e=>e.ActionComplete("Complete"))
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); })
. . . . . . .
)
<script type="text/javascript">
function Complete(args) {
if (args.requestType == "beginedit") { // disable when request type is beginedit
//Grid ID + ColumnName
$("#GridCustomerID").addClass("e-disable");
$("#GridCustomerID").attr("disabled",true); // disable the element from editing
}
}
</script> |