Skip to Content
-2

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 15 at 01:54 PM

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

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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 15 at 04:02 PM

    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
        })]
    })
    
    
    Add comment
    10|10000 characters needed characters exceeded