Skip to Content
avatar image
Former Member

Retain children node when searching Parent node in TreeTable

I've a sap.ui.table.TreeTable and we have provided filtering on the the table.

However, as per the api, when you search the parentNode, the children are not shown and the expand button is hidden.

However, when you search for the children node, the parent node is present with expand button (but only searched children is shown).

This is what I want: irrespective of children or parent search, matched parent node is shown with expand button with all its children

To explain further:

Open TreeTable : https://sapui5.hana.ondemand.com/explored.html#/sample/sap.ui.table.sample.TreeTable.JSONTreeBinding/preview

Now, Search 1: Apply search for parent Node (eg - women)

var f = []; f.push(new sap.ui.model.Filter("name","Contains","Women")); sap.ui.getCore().byId('__xmlview3--TreeTableBasic').bindRows("/catalog/clothing", '', '', f)

Please note id of table ( here: __xmlview3 will keep changing).

So with this search,

existing: Only shows Row with Women with no expand button.

Required: Show Women Row with expand button ( on click of the expand button it shows all its children)

Search 2: Apply search for child Node (eg - Tank top in Women ->Clothing->Tops->Tank Tops)

var f = []; f.push(new sap.ui.model.Filter("name","Contains","Tank Top")); sap.ui.getCore().byId('__xmlview3--TreeTableBasic').bindRows("/catalog/clothing", '', '', f)

Please note id of table ( here: __xmlview3 will keep changing).

So with this search,

existing: Shows Parent node and expand button ( where only searched Child is shown).

Required: Show Women Row with expand button ( on click of the expand button it shows all its children)

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 30, 2017 at 10:40 AM

    Hey did u get any solution for this.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 21 at 10:25 AM

    Hello,

    Did you solve the problem.

    I too have same requirement.

    Add comment
    10|10000 characters needed characters exceeded