Announcement

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

  • Check if grouped grid has data

    Hello,
    To check if a listgrid contains any data, i do the below call for regular listgrids.
    Code:
    if (reportGrid.getRecords() != null && reportGrid.getRecords().length > 0)
    However, for grouped grids, i have a custom method that checks whether it has data. This method is ancient, and i am not sure whether i need it:
    Code:
    public static boolean checkTreeGridHasData(ListGrid gridThatIsGrouped){    
        Tree tree = gridThatIsGrouped.getGroupTree();    
        return (tree != null && tree.getChildren(tree.getRoot()) != null && tree.getChildren(tree.getRoot()).length > 0);
    }
    Do i need this, or is the getRecords() enough also for grouped grids? I must have made the method for SOME reason back in the day....

  • #2
    Hello, please take a look at getOriginalData():
    https://www.smartclient.com/smartcli...etOriginalData

    Comment


    • #3
      Hi mathias,

      this thread is slightly related.

      Best regards
      Blama

      Comment


      • #4
        Thanks guys.

        Comment

        Working...
        X