Hi Syncfusion Team,
our requirement is during editing of one cell (using ejs-numeric textbox) in grid, on click of tab the focus should move to cell in next row in the same column and then that cell should come into edit mode.
And one more query is there anyway we can restrict the values increase/decrease of the ejs-numeric textbox on click of keyboard arrow up and down.
Thanks,
Bhagyasri
|
public oncreate() {
this.element.addEventListener(
'keydown',
function (e) {
if (e.code == 'Tab') {
let row = parentsUntil(e.target, 'e-row', false);
let Index = Number(row.getAttribute('aria-rowindex'));
let colIndex = Number(
e.target.closest('td').getAttribute('aria-colindex')
);
debugger;
var field = document
.getElementById('Normalgrid')
.ej2_instances[0].getColumnByIndex(colIndex).field;
setTimeout(() => {
document
.getElementById('Normalgrid')
.ej2_instances[0].editCell(Index + 1, field);
}, 0);
debugger;
}
}.bind(this)
);
}
|
|
<ejs-grid
#normalgrid
id="Normalgrid"
[dataSource]="data"
allowPaging="true"
[pageSettings]="pageSettings"
[editSettings]="editSettings"
[toolbar]="toolbar"
(load)="onload($event)"
>
. . . . . . . .
</ejs-grid>
public onload() {
NumericTextBox.prototype.keyDownHandler = function (e) {
if (!this.readonly)
switch (e.keyCode) {
case 38:
e.preventDefault();
break;
case 40:
e.preventDefault();
}
};
}
|
Hi Vignesh Natarajan,
Thank you for your reply.
We are binding <ejs-numerictextbox>
Thanks,
Bhagyasri.