Skip to content

Commit b9bd952

Browse files
authored
docs(AnalyticalTable): improve infiniteScroll description & story (#6831)
Closes #6830
1 parent 2fa1454 commit b9bd952

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

packages/main/src/components/AnalyticalTable/AnalyticalTable.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ In this example the default key for sub row detection is used (`subRows`), you c
177177

178178
The table initially contains 50 rows, when the last 10 rows are reached the table will load more data.
179179

180+
**Note:** To prevent the table state from resetting when the data is updated, please see [this recipe](?path=/docs/data-display-analyticaltable-recipes--docs#how-to-stop-the-table-state-from-automatically-resetting-when-the-data-changes).
181+
180182
<Canvas sourceState="none" of={ComponentStories.InfiniteScrolling} />
181183

182184
### Code
@@ -211,6 +213,7 @@ const InfiniteScrollTable = (props) => {
211213
header="Scroll to load more data"
212214
onLoadMore={onLoadMore}
213215
loading={loading}
216+
reactTableOptions: {{ autoResetSelectedRows: false }}
214217
/>
215218
);
216219
};

packages/main/src/components/AnalyticalTable/AnalyticalTable.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ const meta = {
176176
description:
177177
'Defines the columns array where you can define the configuration for each column.<br />Please refer to the [AnalyticalTableColumnDefinition interface](#column-properties) for a full list of options.<br /><br /><b>Must be memoized!</b>'
178178
},
179-
reactTableOptions: { control: { disable: true } },
180179
tableHooks: { control: { disable: true } },
181180
NoDataComponent: { control: { disable: true } },
182181
extension: { control: { disable: true } },
@@ -220,7 +219,8 @@ export const InfiniteScrolling: Story = {
220219
infiniteScroll: true,
221220
infiniteScrollThreshold: 10,
222221
loadingDelay: 500,
223-
header: 'Scroll to load more data'
222+
header: 'Scroll to load more data',
223+
reactTableOptions: { autoResetSelectedRows: false }
224224
},
225225
render: (args, context) => {
226226
const [data, setData] = useState(args.data.slice(0, 50));

packages/main/src/components/AnalyticalTable/types/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,8 @@ export interface AnalyticalTablePropTypes extends Omit<CommonProps, 'title'> {
800800
* Defines whether infinite scroll is active.
801801
*
802802
* __Note:__ It is not recommended to use this prop in combination with a grouped table, as there is no concept for this configuration.
803+
*
804+
* __Note:__ To prevent the table state from resetting when the data is updated, please see [this recipe](https://sap.github.io/ui5-webcomponents-react/v2/?path=/docs/data-display-analyticaltable-recipes--docs#how-to-stop-the-table-state-from-automatically-resetting-when-the-data-changes).
803805
*/
804806
infiniteScroll?: boolean;
805807
/**

0 commit comments

Comments
 (0)