Skip to content

Commit

Permalink
[OBSDEF-35531] DataGrid enhancement for custom page size
Browse files Browse the repository at this point in the history
  • Loading branch information
netraja-chavan committed Apr 15, 2024
1 parent 388de46 commit 1e380c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datagrid/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -640,15 +640,15 @@ export class DataGrid extends React.PureComponent<DataGridProps, DataGridState>

// Function to handle CustomPageSize change in input box
private handleCustomPageSizeChange = () => {
const {maxCustomPageSize, currentPage} = this.state.pagination!;
const {maxCustomPageSize} = this.state.pagination!;
const pageSize = this.customPageSizeRef.current && parseInt(this.customPageSizeRef.current.value);

if (pageSize && maxCustomPageSize && pageSize <= maxCustomPageSize) {
this.getPage(this.state.pagination!.currentPage, pageSize);
} else if (pageSize && maxCustomPageSize && pageSize > maxCustomPageSize) {
if (this.customPageSizeRef.current) {
this.customPageSizeRef.current.value = maxCustomPageSize.toString();
this.getPage(currentPage, parseInt(this.customPageSizeRef.current.value));
this.getPage(1, parseInt(this.customPageSizeRef.current.value));
}
}
};
Expand Down

0 comments on commit 1e380c0

Please sign in to comment.