Quantcast
Channel: SCN : All Content - SAP for Mobile
Viewing all articles
Browse latest Browse all 6147

How to bind items and get data in rows with pagination in sap.m.Table

$
0
0

Hi everyone, I am stucked in getting displaying data from service in the rows. I am getting the data from the service but not able to bind it with table.

 

 

Controller Method:

 

intializeActions: function() {

 

    var unitTable = sap.ui.getCore().byId("oTable");

 

    $.get(appService

            + "/getUnitsByOperationName(operationNameParam='"

            + SHOPFLOOR_OPERATION_NAME + "')", function(data) {

      unitModel.setData({unitRows: data});

      unitTable.setModel(unitModel);

      unitTable.bindItems("/unitRows/d/results");

    }, "json");

 

View:(Table declaration)

oTable = new sap.m.Table("oTable",{visibleRowCount: 5,editable: true});

//adding columns to table

 

          oTable.addColumn(new sap.m.Column({

            header: new sap.m.Text({text:"Unit Number"}),template: oControl,

            sortProperty: "UnitNumber",

            filterProperty: "UnitNumber"}));

         

        oTable.addColumn(new sap.m.Column({

            header: new sap.m.Text({text: "Order Number"}),

             sortProperty: "OrderNumber",

            filterProperty: "OrderNumber"}));

 

          oTable.addColumn(new sap.m.Column({

            header: new sap.m.Text({text: "Unit Status"}),

             sortProperty: "Status",

            filterProperty: "Status"}));

         

          oTable.addColumn(new sap.m.Column({

            header: new sap.m.Text({text: "QtyCreated"}),

             sortProperty: "QtyCreated",

            filterProperty: "QtyCreated"}));

 

          oTable.addColumn(new sap.m.Column({

            header: new sap.m.Text({text: "QtyStarted"}),

             sortProperty: "QtyStarted",

            filterProperty: "QtyStarted"}));

 

oController.intializeActions();

 

Please help me with getting the rows with the data and pagination also in mobile.

Note : It should be responsive and pagination should be used as 100 of records in the DB.


Viewing all articles
Browse latest Browse all 6147

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>