Skip to Content
0

Retain children node when searching Parent node in TreeTable

Apr 11, 2017 at 05:23 PM

121

avatar image
Former Member

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)

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

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

Hey did u get any solution for this.

Share
10 |10000 characters needed characters left characters exceeded