|
@(Html.EJ().Grid<OrdersView>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowPaging()
.AllowSelection()
.SelectionSettings(ss=> {
ss.SelectionMode(mode => mode.AddMode(SelectionMode.Cell));
})
.ClientSideEvents(eve => eve.CellSelected("onGridCellSelected"))
----
.Columns(col =>
{
---
})
)
<script type="text/javascript">
function onGridCellSelected(args) {
var cellIndex = args.cellIndex[0] - 1;
var field = this.getColumnByIndex(cellIndex).field;
var cellData = args.data[field]; // you can get the second cell data when you click for the third cell data in a row
}
</script>
|
|
@(Html.EJ().Grid<OrdersView>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowPaging()
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Batch); })
.ClientSideEvents(eve => eve.CellEdit("onGridCellEditEvent"))
.Columns(col =>
{
---
})
)
<script type="text/javascript">
function onGridCellEditEvent(args) {
var cellIndex = args.cell.index() - 1;
var field = this.getColumnByIndex(cellIndex).field;
var cellData = args.rowData[field]; // you can get the second cell data when you click for the third cell data in a row
}
</script>
|