Skip to content
This repository was archived by the owner on May 19, 2026. It is now read-only.
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions doc/en/components/grids/_shared/keyboard-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,32 +197,32 @@ igRegisterScript("WebGridCustomKBNav", (evtArgs) => {
```

```tsx
<{ComponentSelector} id="grid1" primaryKey="ProductID" gridKeydown={customKeydown}>
<{ComponentSelector} id="grid1" primaryKey="ProductID" onGridKeydown={customKeydown}>
</{ComponentSelector}>
```

<!-- WebComponents -->
```ts
constructor() {
var grid = this.grid = document.getElementById('grid') as {ComponentName}Component;
const grid = this.grid = document.getElementById('grid1') as {ComponentName}Component;
grid.data = this.data
grid.addEventListener("gridKeydown", this.customKeydown);
grid.addEventListener("onGridKeydown", this.customKeydown);
Comment thread
mddragnev marked this conversation as resolved.
Outdated
}
```
<!-- end: WebComponents -->

```typescript
function customKeydown(s: IgrGridBaseDirective, e: IgrGridKeydownEventArgs) {
const detail = e.detail
const target= detail.target;
const evt = detail.event;
const type = detail.targetType;
const customKeydown = (eventArgs: IgrGridKeydownEventArgs) => {
Comment thread
mddragnev marked this conversation as resolved.
const args = eventArgs.detail;
const target= args.target;
const evt = args.event;
const type = args.targetType;

if (type === GridKeydownTargetType.DataCell && target.editMode && evt.key.toLowerCase() === 'tab') {
if (type === 'dataCell' && target.editMode && evt.key.toLowerCase() === 'tab') {
// 1. USER INPUT VALIDATION ON TAB

}
if (type === GridKeydownTargetType.DataCell && evt.key.toLowerCase() === 'enter') {
if (type === 'dataCell' && evt.key.toLowerCase() === 'enter') {
// 2. CUSTOM NAVIGATION ON ENTER KEY PRESS

}
}
```
Expand Down