Announcement

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

    #31
    You've configured local filtering - see the docs for this setting - it means criteria are not sent to the server. Remove this setting.

    Setting initialData is not necessary.

    "rootValue" is set in .ds.xml as simply rootValue="someValue". It's just like all the other settings in the docs.

    Comment


      #32
      initialData

      Hello,

      Well I am on the route down initialData for several reasons. And tend to think it is the right call. I want to have more control about when requests are occurring.

      For example my outline of design is that I load a "subset tree" of our huge tree of data. And then set initial data to this subset tree. Then when a user desires they may "load on demand" any node, which will pull back all children - even ones outside my subset tree.

      So the attached code is my current setof initial data on a tree. And it does now load the data and show it in the tree.

      However, it does not see it as a parent/child tree. Even though I have set the treenodes and id/parent settings.

      What else do I set for the treeGrid so it knows to render a tree here?

      Is there some other flaw in what I have done that I don't see?

      Evan
      Attached Files

      Comment


        #33
        isfolder

        Hello,

        I update my code so that the "internal nodes" are setting isfolder true. Which now has my nodes showing folders and my leaves not. But still they are not showing as a tree, just a list. I can clearly see the id and parentid I am setting for each node and they are correct. So it should show a tree.

        What other settings are there to try?

        To get the root node I am doing two things
        1. likely not needed
        ResultTree rTree = new ResultTree();
        rTree.setModelType(TreeModelType.PARENT);
        rTree.setRootValue("0");
        treeGrid.setDataProperties(rTree);

        2. on the data source
        The java code
        final DataSource ds = DataSource.get(DataSourceInfo.PARENTS_SEARCH_ENITITES_DATASOURCE_MYSQL);
        treeGrid.setDataSource(ds);
        treeGrid.setFetchOperation(eCurrentSearchOnType.getOpIDSearchEntities());

        and in my .ds.xml file
        <fields>
        <field primaryKey="true" name="entkey" type="integer" title="id"></field>
        <field name="parentkey" type="integer" title="parent" foreignKey="entkey" rootValue="0"></field>

        where I have a root node define as

        private TreeNode getRootTreeNode() {
        TreeNode n = new TreeNode();
        n.setIsFolder(true);
        n.setID("0");
        n.setParentID("0");
        n.setTitle("root");
        return n;
        }

        Comment


          #34
          almost there

          Hello,

          How can I have the tree I created start in the "open" position and not collapsed. I tried treeGrid.getData().openAll()
          but that crashed me.

          Attached is my working code so far.

          Next adding children :-)

          Thanks,
          Evan
          Attached Files

          Comment


            #35
            openAll and openFolder not always working

            Hello,

            Sometimes it opens the tree on render sometimes not.
            First I tried the example of having the tree open by using the
            That is the example from the showcase
            Tree/Appearance/Node Titles where
            There is an addDAtaArrivedHandler.
            the .getData.openAll()
            I did try it (see the commented out code in attached file). It did not work at all ...

            This did not work, not sure off hand it fired, perhaps because I am getting the data manually (see attached code) and then using the initialData?

            So with that not working I tried what I am currently using which is the "doOnRender" function and having it open the first 15 folders which is what I want. I don't want to actually openAll, as it is to slow for us. While just iterating and opening the first 15 I think is slick enough.

            So where did I go wrong? I will continue to tweak and play with it, perhaps I will find it.

            Currently it opens sometimes, and others not. So clearly a timing issue (at least).

            Thanks,
            Evan
            Attached Files

            Comment

            Working...
            X