Announcement

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

    Programatically expand nodes in on-demand TreeGrid

    Be sure your post includes:

    Hi,
    I'm using SmartGWT LGPL 2.4 and don't know how to achieve the following:

    I have a databound TreeGrid where I programatically want to expand down to and select some leaf node in the tree that may not have been retrieved from the server yet due to on-demand loading (large tree).
    I do have all the IDs/parentIDs for the tree nodes from leaf up to root so in theory I have all info to fetch all the TreeNode involved.

    I have tried something like the below pseudocode but does not seem to work. I suppose one should also wait for the expand code to asynchronously returning the child dataset before trying to expand the next level.

    Code:
    for (id = rootid; !isLeaf(id); id = childOf(id)) {
      
      ListGridRecord gridRecord = treeGrid.getTree().findById(id);
                  
       if (gridRecord != null) {
           treeGrid.expandRecord(gridRecord);
       }
    }
    Any ideas?
    Last edited by Haiko; 7 Apr 2011, 04:42.

    #2
    Hi Haiko,

    You should do as follows:

    TreeNode node = treeGrid.getTree().findById(treeNodeId);

    // open node if it is closed
    navTree.getTree().openFolders(treeGrid.getTree().getParents(node));

    Comment


      #3
      Hello ,

      I read the java doc for treegrid databing but i can't put this mecanism in my Application :the reason is I have a large tree with 15000 employee and I wan to read the parent node in the first loading of the tree and after when i open the parent node i will watch the leaf node of that node and not for the all tree.

      I attach my code source to help .

      Comment


        #4
        Hi Isomorhic ,

        I have a combo witch contains a picklist that contains records with the same code commune but i want to use the selected record in the combo to keep the field lieudit and fill aother combo with the value of lieudit Field :

        I attach my code source to help .

        thx,Mouna
        Attached Files

        Comment


          #5
          Hi Isomorphic ,

          I have a combo witch contains a picklist that contains records with the same code commune but i want to use the selected record in the combo to keep the field lieudit and fill aother combo with the value of lieudit Field :

          I attach my code source to help .

          thx,Mouna

          Comment


            #6
            I have the same usecase, do you or somebody else have already a solution to this problem?

            Comment


              #7
              Hi Martin00001 ,

              I solved the pbm by adding a pk field in the first combo :I attached my code to help .

              Thx,
              Attached Files

              Comment


                #8
                Hi Isomorphic ,


                I want to use pgination for 9000 records in comboboxItem :Could you please oriente me to choose the best solution to this pbm???

                Comment


                  #9
                  It is working in pages of 75 records by default, see this sample.

                  Best regards
                  Blama

                  Comment

                  Working...
                  X