Filtering level 1 items

Chetan Sharma asked on May 26, 2017 09:58

Hello All,

I have some data in Hierarchy (CMS). I already have a hierarchical viewer in place to show items properly. We need some additional functionality where in we will have a search above it and typing some text and hitting enter will refresh the page and pass this value to Hierarchical viewer to filter results by passing it to a where clause.

The only added complexity is that I just want to filter level 1 items and not level 0 items.

Is there any way to achieve this out of the box?

Cheers, Chetan

Recent Answers


Anton Grekhovodov answered on May 26, 2017 11:10

Hi Chetan, You can create Where condition for your viewer, something like:

(NodeLevel = 1 and NodeName like '{% q %}%') or NodeLevel <> 1

But I don't think that it's good solution. I'd like to do something custom.

1 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on May 26, 2017 11:20

Chetan, how do you pass search term to your filter? Having postback on the page you could also include search phase (or anything) into a query string and use appropriate macro for maximum nesting level property of the hierarchical viewer.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.