Announcement

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

    TreeGrid by databinding without making any fetch to create TreeNode

    Hi
    There is no parent-child relationship in my DB table Rows. And I want to make Tree Grid using Datasource. So, That When I will make fetch to Datasource TreeGrid is populate by itself.
    I don't want to make an extra call to fetch data to make the TreeNode array.

    My data sample in DB is like this.
    ROOT Node1 ChildNode1 ChildNode1-1 Detail1 Detail2 Detail3
    ROOT Node2 ChildNode2 ChildNode2-1 Detail1 Detail2 Detail3
    ROOT Node3 ChildNode3 ChildNode3-1 Detail1 Detail2 Detail3
    ROOT Node3 ChildNode3 ChildNode3-2 Detail1 Detail2 Detail3
    ROOT Node3 ChildNode3 ChildNode3-3 Detail1 Detail2 Detail3
    ROOT Node3 ChildNode3 ChildNode3-4 Detail1 Detail2 Detail3
    And I want to make TreeGrid Like this.

    Click image for larger version

Name:	TreeGrid.png
Views:	118
Size:	13.9 KB
ID:	265259
    If it is possible, How I need to define the properties of the tree grid?
    Kindly Help

    #2
    If you want to use load on demand, then you need to have an idField and parentIdField. You can use server-side code to derive idField and parentIdField values based on the fields in your database that define the relation.

    If you don't need load on demand, you can use DataSource.fetchData() to fetch the entire set of data, and construct a Tree using Tree.add() calls, or via setting up children arrays (modelType:"children").

    Comment


      #3
      I am able to create my tree grid like this by using server-side code to derive idfield and parentIdField values based on the fields in my database that define the relation.
      But, When I clicked on RootNode and make a fetch on the server-side to get Node1, Node2, and Node3 (loadDataOnDemand=true). I am experiencing some kind of glitch.
      during open child nodes first time when a fetch is called to get data for child nodes. It kind of open-close and then open.

      Any solution to solve this problem?

      Comment


        #4
        Sorry, this doesn't tell us much. It sounds like your server is not fulfilling the expected protocol. The protocol and the expectations for what the server should return are extensively documented under the Tree DataBinding overview. If you think you are already doing everything correctly, then please show us your DataSource and all the requests and responses and we can point out the problem.

        Comment

        Working...
        X