Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TreeGrid - how to get the total number of Records?

    Is there a quick way to get the total number of Records (un-collapsed) in a TreeGrid?

    When I do a TreeGrid.getRecords() or TreeGrid.getRecordList() the count is 1 (because the Tree is not expanded).

    #2
    If myTreeGrid is your TreeGrid, then something like

    Code:
    myTreeGrid.getData().getAllNodes().length
    should give you the number of nodes current present in myTreeGrid (glossing over any required null checks). However, note that the above code only counts nodes actually present, not those yet to be loaded due to outstanding fetches (in the case that the grid is databound).
    Last edited by Isomorphic; 2 Jan 2013, 13:01.

    Comment

    Working...
    X