Skip to Content
0
Apr 21, 2020 at 02:53 PM

SAPUI5: How to set a Title for ColumnListItems

131 Views

I do have the following Table:

<Table>
  <columns>
    <Column text="Name" width="200px"/>
    <Column text="Number" width="200px"/>
  </columns>

  <items>
    <ColumnListItem>
      <cells>
        <Text text="{modelExample>name}"/>
        <Text text="{modelExample>number}"/>
      <cells>
    <ColumnListItem>
  </items>
</Table>

with a Model like this:

var modelExample= {
"Model" = [
0:{"title":"First Title","name":"FirstName","number":0},
1:{"title":"First Title","name":"SecondName","number":1},
2:{"title":"Second Title","name":"ThirdName","number":2},
3:{"title":"Second Title","name":"FourthName","number":3}
]}

Issue: It will iterate through all the entries: 0-3 and it will put out the name and also number but i want for it to also be able to put out the titles with the numbers/names which it does have.

Question: How to group the items in such a way that i puts out the title and also all the name/numbers which belong to the titles?