BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
(Html.EJ().Grid<object>("FlatGrid") .Datasource((IEnumerable<object>)ViewBag.datasource) .EditSettings(e => e.AllowEditing().AllowDeleting().AllowAdding().EditMode(EditMode.Batch).AllowEditOnDblClick(true)) .AllowPaging() .Columns(col => { col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add(); col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add(); col.Field("EmployeeID").HeaderText("Employee ID").EditType(EditingType.Dropdown).TextAlign(TextAlign.Right).Width(75).Add(); col.Field("Freight").HeaderText("Freight").EditType(EditingType.Numeric).TextAlign(TextAlign.Right).Width(75).Format("{0:C}").Add(); col.Field("ShipCity").HeaderText("Ship City").Width(110).Add(); }) .ClientSideEvents(eve=> eve.Create("create").CellEdit("celledit").RecordDoubleClick("dblclick")) )
|
<script type="text/javascript">
function create(args) { this._on(this.element, "dblclick", ".e-gridcontent", this._editdblClickHandler); //enable double click event }
function dblclick(args) { args.cancel = true; // prevent default operation this._dblclick = true; this.editCell(args.rowIndex, this.getColumnByIndex(args.cellIndex)["field"]); //trigger editcell }
function celledit(args) { !this._dblclick ? args.cancel = true : this._dblclick = false; } |
<script type="text/javascript">
function create(args) { this._on(this.element, "dblclick", ".e-gridcontent", this._editdblClickHandler); //enable double click event }
function dblclick(args) { args.cancel = true; // prevent default operation this._dblclick = true; this.editCell(args.rowIndex, this.getColumnByIndex(args.cellIndex)["field"]); //trigger editcell }
function celledit(args) { if (!this._dblclick && !this._extkey) args.cancel = true; //prevent default operation for single click else { this._dblclick = false; this._extkey = false; } }
$("#FlatGrid").keydown(function (e) { var obj = $("#FlatGrid").ejGrid("instance"); if (e.keyCode == 9 || e.keyCode == 38 || e.keyCode == 40) { if (e.keyCode != 9) e.target.select(); obj._extkey = true; } else obj._extkey = null; }) |