cancel
Showing results for 
Search instead for 
Did you mean: 

Pagination in sapui5(sap.ui.table.Table with XML view)

0 Kudos

Hi Experts,

Kindly guide me to perform page up and page down functionality from button click in sap.ui.table.table using the below code,with xml view .

oTable2.bindRows({ path: "/TestEntitySet", filters: [ new sap.ui.model.Filter({ path: "Bukrs", operator: sap.ui.model.FilterOperator.EQ, value1: compcode }), new sap.ui.model.Filter({ path: "Usnam", operator: sap.ui.model.FilterOperator.EQ, value1: name }), new sap.ui.model.Filter({ path: "Gjahr", operator: sap.ui.model.FilterOperator.EQ, value1: fiscyear }), new sap.ui.model.Filter({ path: "Currency", operator: sap.ui.model.FilterOperator.EQ, value1: currency }), new sap.ui.model.Filter({ path: "Poper", operator: sap.ui.model.FilterOperator.EQ, value1: month }), new sap.ui.model.Filter({ path: "Blart", operator: sap.ui.model.FilterOperator.EQ, value1: DocumentTyp }) ],urlParameters: { "&$skip": "15", "&$top": "20" } })

Thanks & Regards,

Smruti Ranjan Moharana

+91 9513047604

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Set the visible rowCount of your table to be the number of records you want to see and remove the skip and top from your code. You may also want to set thereshold on your table to prefetch records if you are worried about performance.

oTable2.setVisibleRowCount(20)
oTable2.bindRows({
    path: "/TestEntitySet",
    filters: [new sap.ui.model.Filter({
        path: "Bukrs",
        operator: sap.ui.model.FilterOperator.EQ,
        value1: compcode
    }), new sap.ui.model.Filter({
        path: "Usnam",
        operator: sap.ui.model.FilterOperator.EQ,
        value1: name
    }), new sap.ui.model.Filter({
        path: "Gjahr",
        operator: sap.ui.model.FilterOperator.EQ,
        value1: fiscyear
    }), new sap.ui.model.Filter({
        path: "Currency",
        operator: sap.ui.model.FilterOperator.EQ,
        value1: currency
    }), new sap.ui.model.Filter({
        path: "Poper",
        operator: sap.ui.model.FilterOperator.EQ,
        value1: month
    }), new sap.ui.model.Filter({
        path: "Blart",
        operator: sap.ui.model.FilterOperator.EQ,
        value1: DocumentTyp
    })]
})

Dhanasupriya
Active Participant
0 Kudos

$("#__xmlview2--page-cont").scrollTop(0);

__xmlview2--page-cont -- id of the page where scroll is present.