cancel
Showing results for 
Search instead for 
Did you mean: 

Grouper function worked with json file, but does't work with oData

Former Member
0 Kudos

Hi folks

I copied one javascript code from a sample application, it was working very well when data were retrieved from json file, now the data have been retrieved from oData and the group function does not work anymore. It does not have a java script error, the list is sort is changed, but the result is wrong.

The list before groupping:

The list after the groupping:

how you can see, the lines with "1800" were not grouped, but the sorter were changed

file masterview.xml:

master.controller.xml:

Grouper.js:

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

before you call sort:

list.getBindingInfo("items").groupHeaderFactory = this.getGroupHeader

where getGroupHeader is method in controller

Former Member
0 Kudos

Hi Maksoim and Sanjoy, I had to implement a sorter in the RFC and pass it as a parameter in the RFC caller method, after that, the groupper javascript function worked very well.

Thank you very much.

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

does it stop in grouper? did you try ti implement groupHeaderFactory ? like

groupHeaderFactory: '.getGroupHeader'

getGroupHeader: function (oGroup) {

  return new sap.m.GroupHeaderListItem( {

  title: oGroup.key,

  upperCase: false

  } );

},

Former Member
0 Kudos

Maksim, I am new in UI5, and I didn´t understand how can I use it, can you give me more details, please ?

sanjoy0308
Active Participant
0 Kudos
Former Member
0 Kudos

Sanjoy, thank you, but it is not a table, it is a List, this is the source code:

<List items="{/ObrasListaSet}"
id="list"
mode="{device>/listMode}"
select="handleListSelect"
>
<ObjectListItem id="ObjectListItem"
icon="/sap/bc/ui5_ui5/sap/ZAPUR_RESULTS/image/{Obra}.ico"
type="{device>/listItemType}"
press="handleListItemPress"
title="{Name1}">
<attributes>
<ObjectAttribute text="{
path:'Data',
formatter:'rogga.ui.zresults_obra.util.Formatter.date'
}" />
</attributes>
</ObjectListItem>
</List>