Fix-Show page controls in table widget when server side pagination is enabled and table is resized (#223)
Pagination control UX modified for server side pagination.
This commit is contained in:
parent
c68114331c
commit
859bd0962c
|
|
@ -111,6 +111,7 @@ export const Table = (props: TableProps) => {
|
|||
id={`table${props.widgetId}`}
|
||||
>
|
||||
<TableHeader
|
||||
width={props.width}
|
||||
tableData={props.data}
|
||||
tableColumns={props.columns}
|
||||
searchTableData={props.searchTableData}
|
||||
|
|
|
|||
|
|
@ -72,11 +72,15 @@ interface TableHeaderProps {
|
|||
searchTableData: (searchKey: any) => void;
|
||||
serverSidePaginationEnabled: boolean;
|
||||
displayColumnActions: boolean;
|
||||
width: number;
|
||||
}
|
||||
|
||||
const TableHeader = (props: TableHeaderProps) => {
|
||||
return (
|
||||
<TableHeaderWrapper>
|
||||
<TableHeaderWrapper
|
||||
serverSidePaginationEnabled={props.serverSidePaginationEnabled}
|
||||
width={props.width}
|
||||
>
|
||||
<SearchComponent
|
||||
value={props.searchKey}
|
||||
placeholder="Search..."
|
||||
|
|
@ -121,9 +125,9 @@ const TableHeader = (props: TableHeaderProps) => {
|
|||
)}
|
||||
{!props.serverSidePaginationEnabled && (
|
||||
<PaginationWrapper>
|
||||
{/*<RowWrapper>*/}
|
||||
{/* Showing {props.currentPageIndex + 1}-{props.pageCount} items*/}
|
||||
{/*</RowWrapper>*/}
|
||||
<RowWrapper className="show-page-items">
|
||||
Showing {props.currentPageIndex + 1}-{props.pageCount} items
|
||||
</RowWrapper>
|
||||
<PaginationItemWrapper
|
||||
disabled={props.currentPageIndex === 0}
|
||||
onClick={() => {
|
||||
|
|
|
|||
|
|
@ -258,12 +258,19 @@ export const CellWrapper = styled.div<{ isHidden: boolean }>`
|
|||
}
|
||||
`;
|
||||
|
||||
export const TableHeaderWrapper = styled.div`
|
||||
export const TableHeaderWrapper = styled.div<{
|
||||
serverSidePaginationEnabled: boolean;
|
||||
width: number;
|
||||
}>`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
border-bottom: 1px solid ${Colors.GEYSER_LIGHT};
|
||||
overflow-y: scroll;
|
||||
min-width: ${props =>
|
||||
props.serverSidePaginationEnabled ? 450 : props.width < 700 ? 525 : 700}px;
|
||||
.show-page-items {
|
||||
display: ${props => (props.width < 700 ? "none" : "flex")};
|
||||
}
|
||||
`;
|
||||
|
||||
export const CommonFunctionsMenuWrapper = styled.div`
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user