|
@Html.EJS().Grid("Grid").DataBound("DataBound").DataSource((IEnumerable<object>)ViewBag.dataSource).AllowPaging().
EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true); }).Render()
<script>
var flag = true;
function DataBound() {
if (flag) {
flag = false;
var commandColumn = {
headerText: 'Manage Records', width: 160,
commands: [{ type: 'Edit', buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat' } },
{ type: 'Delete', buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat' } },
{ type: 'Save', buttonOption: { iconCss: 'e-icons e-update', cssClass: 'e-flat' } },
{ type: 'Cancel', buttonOption: { iconCss: 'e-icons e-cancel-icon', cssClass: 'e-flat' } }]
};
this.columns[0].isPrimaryKey = true;
this.columns.push(commandColumn);
this.refreshColumns();
}
}
</script> |