Skip to Content

Documentation for items in sap.m.Table

Hello..

I am not an expert developer, so my question would sound very trivial. Please bear with me :)

I can see many other properties are being used in "items" property of of sap.m.Table.

For example:

<Table id="table" width="auto" 
.....
items="{ path: '/ProductSet', sorter: { path: 'ProductID', descending: false }, parameters: { expand: 'ToSupplier' } }">

Can some one please tell me where to find the SAP documentation for the usage of these JSON properties mentioned inside "items" (path, sorter, parameters etc in the above example)? On what basis these usages are done. Are there more properties which can be used here?

Regards,

SL

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 23, 2017 at 07:41 AM

    Hello,

    "items" property is inherited by sap.m.Table from sap.m.ListBase. You can see items as an aggregation for sap.m.ListBase. And both sap.m.Table and sap.m.ListBase inherit the class sap.ui.base.ManagedObject

    So, if you want more details about items aggregation, you can have a look at bindAggregation of sap.ui.base.ManagedObject

    Here is the link which mentions the list of properties for items:

    https://openui5.hana.ondemand.com/#/api/sap.ui.base.ManagedObject/methods/bindAggregation

    Regards,

    Fahad Hamsa

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 23, 2017 at 08:51 AM

    Hello,

    Yours is a very good question ! m.table implements the items, an aggregration property extended from listbase. This items aggregration , Defines the items contained within this control. In case of our table, say it is a list item. Now, SAPUI5 provides tools to sort, group and filter these items as per the user requirements(thus providing better user experience and also variants).

    Now to sort the items in the table you should use :

    ....items="{path : '/results',sorter : {path : 'Orderid',descending : true}}"......

    Sorter is the property of the object, the value consists of the path and descending property, also you can add grouping as true if you want the grouping to be done.

    Similarly, you can also try out with the filtering also in items aggregration.

    Links :

    https://sapui5.hana.ondemand.com/#/api/sap.m.ListBase -- For learning on the items property.

    https://sapui5.hana.ondemand.com/#/api/sap.ui.model.Sorter -- For sorting.

    https://sapui5.hana.ondemand.com/#/api/sap.ui.model.Filter -- For filtering.

    https://sapui5.hana.ondemand.com/#/sample/sap.m.sample.ListGrouping/preview -- For grouping.Check the code too.

    Hope this helps,

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 23, 2017 at 12:17 PM

    Hello Fahad/Arjun,

    Thanks for the response. I am clear with it now :)

    Regards,

    SL

    Add comment
    10|10000 characters needed characters exceeded