Announcement

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

    ListGrid getRecords() Returing Empty Array

    There is a Problem with getRecords() method of ListGrid, always giving an Empty Array.

    I use a Tree Grid, and Each Time I Call grid.getRecords(), i get an Empty Array of ListGridRecord, even though there were 10 Records added to the Grid, I Use the Latest Version of SWT i.e smartGwt-1.0b2 ,

    #2
    See getTree().

    Comment


      #3
      Not Working

      I Even Tried
      Code:
       grid.getTree().getData();
      Which returns an array of ListGridRecord[] , But Returning an Empty Array

      Comment


        #4
        still no list grid record via the functions getRecords() and .getTree().getData();

        I have an TreeGrid that displays data from an data source. When i try to get the selected fields of the grid, everything works fine. But trying to get all record sets from the grid always returns empty arrays.

        the tree grid:
        Code:
        TreeGrid tg = new TreeGrid();
        tg.addDragStopHandler(eventHandler);
        tg.setDataSource(classController.getDefaultFields());
        tg.setAutoFetchData(true);
        the event handler:
        Code:
        TreeGrid tg = (TreeGrid) event.getSource();
        ListGridRecord[] selection = tg.getSelection(); // array of selected values
        ListGridRecord[] records = tg.getRecords(); // empty array
        ListGridRecord[] data = tg.getTree().getData(); // empty array

        Comment


          #5
          TreeGrid.getRecords() has been fixed to return the TreeNode's as a flat list of ListGridRecord's.

          You should however try to work with the Tree datastructure when working with a TreeGrid.

          Tree.getData() only returns the initial data. To get a flat list of nodes from the Tree, you can use

          Code:
          TreeNode[] nodes = tree.getOpenList(tree.getRoot());

          Comment


            #6
            thanks a lot ...

            ... for fixing that function. that makes a lot of the stuff i try do much easier :-)

            thanks for the suggestion of using the tree functions, but i do not need the tree structure. at the moment i try to do some sort of cube grid in smartgwt and is use an tree grid to display the possible fields that could be used by the grid. i need to check the relations between the fileds at some times an it is much easier to access the list grid records than the data from the data source, because of the need to use a callback function. getting the data from the grid has the advantage that i donīt have to load the data via rpc call whenever i need it.

            Comment


              #7
              i used the fixed TreeGrid.getRecords() but it throw Exception Can't cast listGridRecord To TreeNodes while executing tree.getOpenList(tree.getRoot());

              is there any other methods that can return the nodes as listGridRecords without casting it to TreeNodes ??????????
              please help !!!!!!!!

              Comment


                #8
                Originally posted by amn
                i used the fixed TreeGrid.getRecords() but it throw Exception Can't cast listGridRecord To TreeNodes while executing tree.getOpenList(tree.getRoot());

                is there any other methods that can return the nodes as listGridRecords without casting it to TreeNodes ??????????
                please help !!!!!!!!
                You haven't posted which version of Smart GWT you're using and this is working fine for other users. Post all the details and a standalone testcase if you think you've found a bug.

                Comment

                Working...
                X