You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(react-grid): remove totalCount property from PagingState to CustomPaging (#555)
BREAKING CHANGES:
We have moved the PagingState plugin's `totalCount` property to the CustomPaging plugin to improve API consistency. Now, you can add the CustomPaging plugin to a project and specify its `totalCount` property to implement remote paging.
Before:
```js
<Grid>
<...>
<PagingState totalCount={10} />
</Grid>
```
After:
```js
<Grid>
<...>
<PagingState />
<CustomPaging totalCount={10} />
</Grid>
```
Copy file name to clipboardExpand all lines: packages/dx-react-grid/docs/guides/paging.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,34 +7,35 @@ The Grid component supports data paging. You can specify the page size and switc
7
7
The following plugins implement filtering features:
8
8
9
9
-[PagingState](../reference/paging-state.md) - controls the paging state
10
+
-[CustomPaging](../reference/custom-paging.md) - allows implementing a custom totalCount calculation logic
10
11
-[IntegratedPaging](../reference/integrated-paging.md) - performs built-in data paging
11
12
-[PagingPanel](../reference/paging-panel.md) - renders the Paging Panel
12
13
13
14
Note that the [plugin order](./plugin-overview.md#plugin-order) is important.
14
15
15
16
## Basic Paging Setup
16
17
17
-
Import the plugins listed above to set up a Grid with basic paging.
18
+
Use the `PagingState`, `LocalPaging` (or `CustomPaging`), and `PagingPanel` plugins to set up a Grid with paging.
18
19
19
20
## Uncontrolled Mode
20
21
21
-
In the [uncontrolled mode](controlled-and-uncontrolled-modes.md), specify the initial active page index in the `PagingState` plugin's `defaultCurrentPage` property.
22
+
In [uncontrolled mode](controlled-and-uncontrolled-modes.md), specify the initial active page index in the `PagingState` plugin's `defaultCurrentPage` property.
22
23
23
-
In the following example, the page size is specified using the `PagingState` plugin's `pageSize` property, which is usual for the controlled mode. However, the `onPageSizeChange` event handler is not specified because page size is not supposed to be changed internally as the Page Size Selector is not available.
24
+
In the following example, the page size is specified using the `PagingState` plugin's `pageSize` property, which is usual for the controlled mode. However, the `onPageSizeChange` event handler is not specified because the page size is not supposed to be changed internally as the Page Size Selector is not available.
24
25
25
26
.embedded-demo(paging/uncontrolled-mode)
26
27
27
28
## Page Size Selection
28
29
29
30
Assign an array of available page sizes to the `PagingPanel` plugin's `pageSizes` property to enable page size selection via the UI. The Page Size Selector displays the 'All' item if the specified array contains an item whose value is 0. You can specify custom text for this Page Size Selector item using the `messages.showAll` property.
30
31
31
-
The example below demonstrates the basic configuration for the uncontrolled mode. The `PagingState` plugin's `defaultPageSize` property defines the initial page size.
32
+
The example below demonstrates a basic configuration for the uncontrolled mode. The `PagingState` plugin's `defaultPageSize` property defines the initial page size.
32
33
33
34
.embedded-demo(paging/page-size-selector)
34
35
35
36
## Controlled Mode
36
37
37
-
In the [controlled mode](controlled-and-uncontrolled-modes.md), specify the following `PagingState` plugin property pairs to set a state value and handle its changes:
38
+
In [controlled mode](controlled-and-uncontrolled-modes.md), specify the following `PagingState` plugin property pairs to set a state value and handle its changes:
38
39
39
40
-`currentPage` and `onCurrentPageChange` - the currently displayed page's index
40
41
-`pageSize` and `onPageSizeChange` - the page size
@@ -45,14 +46,14 @@ Note that the `onPageSizeChange` handler makes sense only if the `pageSizes` opt
45
46
46
47
## Remote Paging
47
48
48
-
You can handle the Grid's paging state changes to request a page data from the server according to the current page index and page size if your data service supports paging.
49
+
You can handle the Grid's paging state changes to request page data from the server according to the current page index and the page size if your data service supports paging.
49
50
50
-
Paging options are updated once an end-user interacts with Paging Panel controls. Handle paging option changes using the `PagingState` plugin's `onCurrentPageChange` and `onPageSizeChange` events and request data from the server using the applied paging options. Once the page data is received from the server, pass it to the `Grid` component's `rows` property.
51
+
Paging options are updated once an end-user interacts with Paging Panel controls. Handle paging option changes using the `PagingState` plugin's `onCurrentPageChange` and `onPageSizeChange` events, and request data from the server using the applied paging options. Once the page data is received from the server, pass it to the `Grid` component's `rows` property.
51
52
52
-
Note that in the case of remote paging, you do not need to use the `IntegratedPaging` plugin.
53
+
For remote paging, use the `CustomPaging` plugin instead of the `IntegratedPaging` plugin.
53
54
54
55
.embedded-demo(paging/remote-paging)
55
56
56
57
## Using Paging with Other Data Processing Plugins
57
58
58
-
When you use paging features with sorting, grouping, or filtering, take a note of the order in which the plugins appear in the Grid's container. You need to choose whether to paginate filtered rows or filter the current page. In the first case, put the `IntegratedFiltering` plugin before the `IntegratedPaging` one. Otherwise, inverse the plugins' order.
59
+
When you use paging features with sorting, grouping, or filtering, take note of the order in which the plugins appear in the Grid's container. You need to choose whether to paginate filtered rows or filter the current page. In the former case, put the `IntegratedFiltering` plugin before the `IntegratedPaging` one. Otherwise, inverse the plugins' order.
0 commit comments