Add rowsPerPageOptions prop support
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Mon, 25 Jun 2018 14:36:49 +0000 (16:36 +0200)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Mon, 25 Jun 2018 14:36:49 +0000 (16:36 +0200)
Feature #13678

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

src/components/data-explorer/data-explorer.tsx
src/store/data-explorer/data-explorer-reducer.ts

index 9cc1cc95fc6138d337dc3178feaf36010c661195..98f6f868c6f19defe2a3da55d4bfb46344328ce6 100644 (file)
@@ -19,6 +19,7 @@ interface DataExplorerProps<T> {
     contextActions: ContextMenuActionGroup[];
     searchValue: string;
     rowsPerPage: number;
+    rowsPerPageOptions?: number[];
     page: number;
     onSearch: (value: string) => void;
     onRowClick: (item: T) => void;
@@ -78,6 +79,7 @@ class DataExplorer<T> extends React.Component<DataExplorerProps<T> & WithStyles<
                         <TablePagination
                             count={this.props.items.length}
                             rowsPerPage={this.props.rowsPerPage}
+                            rowsPerPageOptions={this.props.rowsPerPageOptions}
                             page={this.props.page}
                             onChangePage={this.changePage}
                             onChangeRowsPerPage={this.changeRowsPerPage}
index 0069085b1b43f318da79cf18896dcfe2c86e2900..efb45da8322b6e0c83f3f36ace56e421883da9ed 100644 (file)
@@ -12,6 +12,7 @@ interface DataExplorer {
     items: any[];
     page: number;
     rowsPerPage: number;
+    rowsPerPageOptions?: number[];
     searchValue: string;
 }
 
@@ -19,7 +20,8 @@ export const initialDataExplorer: DataExplorer = {
     columns: [],
     items: [],
     page: 0,
-    rowsPerPage: 0,
+    rowsPerPage: 10,
+    rowsPerPageOptions: [5, 10, 25, 50],
     searchValue: ""
 };