|
@(Html.EJ().Grid<object>("Recipe_FlatGrid")
.AllowPaging()
.Datasource((IEnumerable<object>)ViewBag.datasource)
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Batch).RowPosition(RowPosition.Bottom); })
.AllowPaging()
.PageSettings(Page => Page.PageSize(150))
.ClientSideEvents(eve => eve.ActionComplete("Complete").CellSave("save").BeforeBatchAdd("beforeBatchAdd"))
.Columns(col =>
{
. . . . . . .
}))
<script type="text/javascript">
var c;
function beforeBatchAdd(args) {
c = ej.max(this.model.dataSource, "OrderID").OrderID + 1;
args.defaultData.OrderID = c;
}
. . . . . .
</script> |
|
|