cancel
Showing results for 
Search instead for 
Did you mean: 

How to change page of table dynamically?

Former Member
0 Kudos

I have a table with pagination in which i am searching one item if table has 10 page i want to show that page which corresponds to the search item for which i need to show the page which has the item but i am not able to show the page even after setting the property

oTable._oPaginator.setCurrentPage(2)

Any help would be highly appreciated

Thanks and Regards

:S

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Muhammad,

try to add the following code:

if (oTable._oPaginator.getDomRef()) {oTable._oPaginator.rerender();

}

Even though it is not recommended to access the Paginator in that way, as _oPaginator is a private property of the table.

A cleaner way would be to extend the sap.ui.table.Table and add a new method for your requirement.

Regards,

Daniel

Former Member
0 Kudos

Its changing the page number but not switching the control to that page

Former Member
0 Kudos

Try to also set the firstVisibleRow property:


oTable.setProperty("firstVisibleRow", iRowNumber, true);


where iRowNumber could be calculated like this:


var iRowNumber = (iNewPage - 1) * this.getVisibleRowCount()

Former Member
0 Kudos

This really help in addition i just rerender the table object also like this

oTable.rerender() and its done

Thanks a lot i am very much grateful

Answers (0)