Skip to content

Commit 299852e

Browse files
authored
Merge pull request #10 from DHTMLX/mr-next-combobox-accessibility-4586
[add] resetfocus(), update focuschange events for list and dataview
2 parents 577c89f + 29617b1 commit 299852e

File tree

7 files changed

+62
-8
lines changed

7 files changed

+62
-8
lines changed

docs/dataview/api/api_overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ description: You can explore the API of DataView in the documentation of the DHT
1515
| [](dataview/api/dataview_getfocus_method.md) | @getshort(dataview/api/dataview_getfocus_method.md) |
1616
| [](dataview/api/dataview_getfocusitem_method.md) | @getshort(dataview/api/dataview_getfocusitem_method.md) |
1717
| [](dataview/api/dataview_paint_method.md) | @getshort(dataview/api/dataview_paint_method.md) |
18+
| [](dataview/api/dataview_resetfocus_method.md) | @getshort(dataview/api/dataview_resetfocus_method.md) |
1819
| [](dataview/api/dataview_setfocus_method.md) | @getshort(dataview/api/dataview_setfocus_method.md) |
1920

2021
:::info important

docs/dataview/api/dataview_focuschange_event.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@ description: You can explore the focusChange event of DataView in the documentat
88

99
@short: fires on moving focus to a new item
1010

11-
@signature: {'focusChange: (focusIndex: number, id: string | number) => void;'}
11+
@signature: {'focusChange: (focusIndex?: number, id?: string | number) => void;'}
1212

1313
@params:
14-
- `focusIndex: number` - the position of an item in focus
15-
- `id: string | number` - the id of the item
14+
The callback of the **focusChange** event is called with the following parameters:
15+
16+
- `focusIndex` - (optional) the position of an item in focus
17+
- `id` - (optional) the id of the item
1618

1719
@example:
18-
dataview.events.on("focusChange", function(index, id){
20+
dataview.events.on("focusChange", function(focusIndex, id){
1921
// your code here
2022
});
2123

2224
@descr:
2325

2426
**Related sample**: [Dataview. Events](https://snippet.dhtmlx.com/2d74uyoh)
27+
28+
@changelog:
29+
- Parameters of the callback function became optional in v8.3.14
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
sidebar_label: resetFocus()
3+
title: JavaScript DataView - resetFocus Method
4+
description: You can explore the resetFocus method of DataView in the documentation of the DHTMLX JavaScript UI library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Suite.
5+
---
6+
7+
# resetFocus()
8+
9+
@short: resets focus and moves the scroll to the beginning of the dataview
10+
11+
@signature: {'resetFocus(): void;'}
12+
13+
@example:
14+
dataview.resetFocus();
15+
16+
@descr:
17+
18+
19+
@changelog:
20+
added in v8.4

docs/list/api/api_overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ description: You can explore the API of List in the documentation of the DHTMLX
1515
| [](list/api/list_getfocus_method.md) | @getshort(list/api/list_getfocus_method.md) |
1616
| [](list/api/list_getfocusitem_method.md) | @getshort(list/api/list_getfocusitem_method.md) |
1717
| [](list/api/list_paint_method.md) | @getshort(list/api/list_paint_method.md) |
18+
| [](list/api/list_resetfocus_method.md) | @getshort(list/api/list_resetfocus_method.md) |
1819
| [](list/api/list_setfocus_method.md) | @getshort(list/api/list_setfocus_method.md) |
1920

2021
:::info important

docs/list/api/list_focuschange_event.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@ description: You can explore the focusChange event of List in the documentation
88

99
@short: fires on moving focus to a new item
1010

11-
@signature: {'focusChange: (focusIndex: number, id: string | number) => void;'}
11+
@signature: {'focusChange: (focusIndex?: number, id?: string | number) => void;'}
1212

1313
@params:
14-
- `focusIndex: number` - the position of an item
15-
- `id: string | number` - the id of an item
14+
The callback of the **focusChange** event is called with the following parameters:
15+
16+
- `focusIndex` - (optional) the position of an item
17+
- `id` - (optional) the id of an item
1618

1719
@example:
18-
list.events.on("focusChange", function(index, id){
20+
list.events.on("focusChange", function(focusIndex, id){
1921
// your code here
2022
});
2123

2224
@descr:
2325

2426
**Related sample**: [List. Events](https://snippet.dhtmlx.com/iwt1yd61)
27+
28+
@changelog:
29+
- Parameters of the callback function became optional in v8.3.14
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
sidebar_label: resetFocus()
3+
title: JavaScript List - resetFocus Method
4+
description: You can explore the resetFocus method of List in the documentation of the DHTMLX JavaScript UI library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Suite.
5+
---
6+
7+
# resetFocus()
8+
9+
@short: resets focus and moves the scroll to the beginning of the list
10+
11+
@signature: {'resetFocus(): void;'}
12+
13+
@example:
14+
list.resetFocus();
15+
16+
@descr:
17+
18+
19+
@changelog:
20+
added in v8.4

sidebars.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ module.exports = {
591591
"dataview/api/dataview_getfocus_method",
592592
"dataview/api/dataview_getfocusitem_method",
593593
"dataview/api/dataview_paint_method",
594+
"dataview/api/dataview_resetfocus_method",
594595
"dataview/api/dataview_setfocus_method",
595596
],
596597
},
@@ -2992,6 +2993,7 @@ module.exports = {
29922993
"list/api/list_getfocus_method",
29932994
"list/api/list_getfocusitem_method",
29942995
"list/api/list_paint_method",
2996+
"list/api/list_resetfocus_method",
29952997
"list/api/list_setfocus_method",
29962998
],
29972999
},

0 commit comments

Comments
 (0)