Hi Costa,
Thanks for contacting Syncfusion support.
According to your query you need to focus the cell which is double clicked while editing. We have achieved your requirement in the below code example using the actionComplete event and recordDoubleClick event of grid.
Refer the below code example.
|
<ej-grid id="FlatGrid" allow-paging="true" allow-filtering="true" action-complete="actionComplete" record-double-click="doubleClick">
…….
<e-edit-settings allow-adding="true" allow-editing="true" allow-deleting="true"></e-edit-settings>
<e-columns>
…..
</e-column>
</e-columns>
</ej-grid>
<script>
function doubleClick(args) {
this.model.columnName = this.getColumnByIndex(args.cellIndex).field;
}
function actionComplete(args) {
if (args.requestType == "beginedit") {
var elem = $("#FlatGrid" + this.model.columnName);
if (elem.hasClass("e-dropdownlist"))
elem.closest(".e-ddl").focus();
else if (elem.hasClass("e-numerictextbox"))
elem.siblings('input:visible').first().select().focus();
else
elem.focus().select();
}
}
</script> |
In the RecordDoubleClick, we can get the column name using cell index. Based on the column name, you can focus the element that you have clicked in the ActionComplete event. Here, this.model.columnName is implicit variable and we are adding it manually.
We have prepared a sample for your convenience which can be downloaded from below location.
Regards,
Sathyanarayanamoorthy