<input type="checkbox" class="checkboxcolumn" />
--------------------
<script type="text/javascript">
$(document).on('change', '.checkboxcolumn', function () { //this function triggered while the check box state get changed
if (this.checked) {
var gridObj = $("#FlatGrid").ejGrid('instance'); // Create Grid object.
var row = gridObj.getRowByIndex(gridObj.model.selectedRowIndex); //Get the selected row from the grid
gridObj.startEdit(row); // Get to edit the selected record
}
});
</script> |
@(Html.EJ().Grid<OrdersView>("Editing")
---------------
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).ValidationRules(v => v.AddRule("required", true).AddRule("number", true)).Width(90).Add();
col.Field("CustomerID").HeaderText("Customer ID").Width(90).ValidationRules(v => v.AddRule("required", true).AddRule("minlength", 3)).Add();
col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(75).EditType(EditingType.Numeric).Width(75).NumericEditOptions(new EditorProperties() { DecimalPlaces = 2 }).ValidationRules(v => v.AddRule("range", "[0,1000]")).Format("{0:C}").Add();
col.Field("ShipCountry").HeaderText("Ship Country").EditType(EditingType.Dropdown).Width(85).Add();
col.Field("ShipCity").HeaderText("Ship City").Width(90).Add();
})
.ClientSideEvents(eve => { eve.ActionComplete("complete"); })
) |