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(500);
|
||||||
cy.wait("@postExecute");
|
cy.wait("@postExecute");
|
||||||
cy.wait(500);
|
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.get(".t--table-widget-next-page").should("not.have.attr", "disabled");
|
||||||
cy.ValidateTableData("1");
|
cy.ValidateTableData("1");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,11 @@ function TableHeader(props: TableHeaderProps) {
|
||||||
|
|
||||||
{props.isVisiblePagination && props.serverSidePaginationEnabled && (
|
{props.isVisiblePagination && props.serverSidePaginationEnabled && (
|
||||||
<PaginationWrapper>
|
<PaginationWrapper>
|
||||||
|
{props.totalRecordsCount ? (
|
||||||
|
<RowWrapper className="show-page-items">
|
||||||
|
{props.totalRecordsCount} Records
|
||||||
|
</RowWrapper>
|
||||||
|
) : null}
|
||||||
<PaginationItemWrapper
|
<PaginationItemWrapper
|
||||||
className="t--table-widget-prev-page"
|
className="t--table-widget-prev-page"
|
||||||
disabled={props.pageNo === 0}
|
disabled={props.pageNo === 0}
|
||||||
|
|
@ -174,9 +179,20 @@ function TableHeader(props: TableHeaderProps) {
|
||||||
>
|
>
|
||||||
<Icon color={Colors.HIT_GRAY} icon="chevron-left" iconSize={16} />
|
<Icon color={Colors.HIT_GRAY} icon="chevron-left" iconSize={16} />
|
||||||
</PaginationItemWrapper>
|
</PaginationItemWrapper>
|
||||||
<PaginationItemWrapper className="page-item" selected>
|
{props.totalRecordsCount ? (
|
||||||
{props.pageNo + 1}
|
<RowWrapper>
|
||||||
</PaginationItemWrapper>
|
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
|
<PaginationItemWrapper
|
||||||
className="t--table-widget-next-page"
|
className="t--table-widget-next-page"
|
||||||
disabled={
|
disabled={
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user