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


          #5
          Hey there, this is embarrasing, but i just now got around to actually looking at this :)

          I might be mistaken, but i checked getOriginalData, and I don't think you've exposed this method in smartGWT? I am checking in 13d.

          Comment


            #6
            mathias getOriginalResultSet() should be exposed. Check the docs if they do the same.

            Best regards,
            Blama

            Comment


              #7
              Ah, there it is, thanks.

              Comment

              Working...
              X