Announcement

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

    Treegrid : show opener icon on empty folders by not on leaves

    Hi!

    I need your help because I cannot understand my tree behaviour.
    I have a parent linking, load on demand tree.
    What I want is to display the opener icon on folders (whatever their number of children) but not on leaves. I thought the treeGRid.setAlwaysShowOpener() method will do the job but it is not the case: every node (folders and leaves) have the opener icon.
    What should I do to implement the beahviour I wish?

    Here is a sample of my code :
    Code:
    ResultTree tree = new ResultTree();
    tree.setModelType(TreeModelType.PARENT);
    tree.setIdField("id");
    tree.setParentIdField("parentId");
    tree.setIsFolderProperty("hasChildren");
    [...]
    
    treeGrid = new TreeGrid();
    treeGrid.setDataProperties(tree);
    treeGrid.setDataSource(dataSource);
    treeGrid.setAutoFetchData(true);
    [...]
    treeGrid.setAlwaysShowOpener(true);
    [...]
    (I did not pu my full code because it is very long. May some other methods or handlers interact with the opener icon?)

    #2
    The paradigm is fairly simple
    - if TreeGrid.showOpener is set to true, the opener icon will be displayed next to folders in most cases
    - if TreeGrid.alwaysShowOpener is false, the opener won't be displayed for empty folder (folders with no children). If it is true, the opener will be displayed for folders regardless of whether they have any children or not
    - The opener icon is never shown for "leaf" nodes [nodes that are not folders]
    - Whether a node is a leaf or a folder can be explicitly specified via the "isFolderProperty". Otherwise the "defaultIsFolder" property is consulted to determine whether nodes are automatically assumed to be folders rather than leaves.

    This mechanism is well tested and we are not aware of any framework bugs with it. If this info isn't enough to get things working in your app, we'd recommend you build a small standalone test case - probably a simple clientOnly dataSource with similar fields to your real app's dataSource, and just a handful of records, and a TreeGrid that performs a fetch against this dataSource and see if you can reproduce the problems you're experiencing there. It's likely that the process of building this simpler test case will make it obvious what is wrong with your app's design, and if not, you'll have a simple standalone test case you can share with us which will allow us to comment on whether there's a previously undetected framework issue or whether it's just a usage issue we need to clarify.

    Thanks
    Isomorphic Software

    Comment


      #3
      I built a simple test case with simple xml datasource adapted from your showcase samples. You can find it in the attached files.
      The result I have is :
      Click image for larger version

Name:	Capture_tree.PNG
Views:	94
Size:	8.6 KB
ID:	232829
      Whereas the result I expect is :
      Click image for larger version

Name:	Capture_tree_expected.png
Views:	88
Size:	12.2 KB
ID:	232831
      I do not understand why the leaves also have an opener icon whereas they are well recognized as leaves as they have my star icon.

      Please tell me if it is a bug of yours or if I did something wrong?
      Attached Files

      Comment


        #4
        We'll take a look. Thanks

        Regards
        Isomorphic Software

        Comment


          #5
          This is a bug. We shouldn't be showing the opener icon next to leaves.
          We've made a change to address this in the framework in 10.0 and 10.1. Please try the next nightly build to pick this up (dated Nov 20 or above)

          Regards
          Isomorphic Software

          Comment


            #6
            OK thanks!
            I'll wait for the next nightly build and try with this new version.

            Comment


              #7
              I got the Nov 20 build and it works very well! Thanks a lot!

              Comment

              Working...
              X