Forum Stats

  • 3,837,271 Users
  • 2,262,245 Discussions


Given the ojtree element, how to get the child elements which are visible in the viewport?

User_JV7C1 Member Posts: 60 Employee

We are on JET version 10.1.0. We are using ojTree component and the size of data rendered with the tree is huge. I have a use case, given the ojTree element, I need the child elements which are visible in the view port.

I see that there are ways to find if a given element is visible in view port, however there is no working utility available which will accept a parent element and return its children which are visible in the view port.

I can get the children of the tree and iterate through them to check which ones are visible in the viewport, however given the size of the data we are dealing with, that would be an expensive operation and I am looking for a util with optimized performance.

Can anyone suggest the most efficient way to do this?



  • Hopefully you are using the oj-tree-view and not the old jQueryUI based ojTree. The ojTree component itself was deprecated almost 4 years ago and is completely removed from the JET distribution in v12.

    There is nothing in the JET API that is going to provide the information that you are looking for, no. You would need to do whatever JavaScript code you say you have to do this.

  • User_JV7C1
    User_JV7C1 Member Posts: 60 Employee

    Hi John, Thanks for the response. We are currently using ojTree and will plan on replacing it with ojTreeView. In the release notes of JET 12.0.0, 12.1.0 this information is not mentioned (about ojTree being removed completely), so should we remove the usage immediately if we are planning on a JET version upgrade (to v12 or v13)?