feat: add total records and pageCount to table header
This commit is contained in:
parent
a6fe504768
commit
86ce80abc3
|
|
@ -73,6 +73,11 @@ describe("Test Create Api and Bind to Table widget", function() {
|
|||
cy.wait(500);
|
||||
cy.wait("@postExecute");
|
||||
cy.wait(500);
|
||||
cy.get(".show-page-items").should("contain", "20 Records");
|
||||
cy.get(".page-item")
|
||||
.next()
|
||||
.should("contain", "of 2");
|
||||
|
||||
cy.get(".t--table-widget-next-page").should("not.have.attr", "disabled");
|
||||
cy.ValidateTableData("1");
|
||||
|
||||
|
|
|
|||
|
|
@ -165,6 +165,11 @@ function TableHeader(props: TableHeaderProps) {
|
|||
|
||||
{props.isVisiblePagination && props.serverSidePaginationEnabled && (
|
||||
<PaginationWrapper>
|
||||
{props.totalRecordsCount ? (
|
||||
<RowWrapper className="show-page-items">
|
||||
{props.totalRecordsCount} Records
|
||||
</RowWrapper>
|
||||
) : null}
|
||||
<PaginationItemWrapper
|
||||
className="t--table-widget-prev-page"
|
||||
disabled={props.pageNo === 0}
|
||||
|
|
@ -174,9 +179,20 @@ function TableHeader(props: TableHeaderProps) {
|
|||
>
|
||||
<Icon color={Colors.HIT_GRAY} icon="chevron-left" iconSize={16} />
|
||||
</PaginationItemWrapper>
|
||||
<PaginationItemWrapper className="page-item" selected>
|
||||
{props.pageNo + 1}
|
||||
</PaginationItemWrapper>
|
||||
{props.totalRecordsCount ? (
|
||||
<RowWrapper>
|
||||
Page{" "}
|
||||
<PaginationItemWrapper className="page-item" selected>
|
||||
{props.pageNo + 1}
|
||||
</PaginationItemWrapper>{" "}
|
||||
<span>{`of ${props.pageCount}`}</span>
|
||||
</RowWrapper>
|
||||
) : (
|
||||
<PaginationItemWrapper className="page-item" selected>
|
||||
{props.pageNo + 1}
|
||||
</PaginationItemWrapper>
|
||||
)}
|
||||
|
||||
<PaginationItemWrapper
|
||||
className="t--table-widget-next-page"
|
||||
disabled={
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user