Announcement

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

    Customizing the Tree of a databound TreeGrid

    Here's a related question:

    I have a TreeGrid bound to a data source with load on demand. Since the tree data all comes from the data source there is no Tree object defined on the TreeGrid, i.e.:

    Code:
    isc.TreeMenu.create({
        ID: "ControlPanelMenu",
        menuID: 1,
        width: "100%",
        height: "100%",
        dataSource: "menuItemsDS",
        loadDataOnDemand: true,
        autoFetchData: true
    });
    So here's my question: how do I set, for instance, isFolderProperty? If my TreeMenu had a defined 'data' property with a Tree, then I could do it easily by setting Tree.isFolderProperty. But what if I want to use one of the fields returned by the data source to set the value returned by isFolder()? How exactly would I do that?

    Likewise, there are similar properties on the Tree object, such as nameProperty, openProperty, etc., that I would like to be able to set for a databound TreeGrid. So in general, how do I use these properties if I'm not explicitly defining a Tree?

    #2
    Oh, I should mention: TreeMenu is an overloaded version of TreeGrid, essentially the same object with a couple of added properties and methods.

    Comment


      #3
      Hello ledfini,

      You can use dataProperties to customize the ResultTree automatically created when fetchData() is called on a TreeGrid. As far as doing it on the fly as data is being received, you could do so from dataSource.transformResponse, because at that time the ResultTree has been created and is available as dsRequest.resultTree.

      Comment


        #4
        Thanks, that worked perfectly. I don't really need to set properties like isFolderProperty on the fly, as long as isFolder() returns the value of a data field loaded on demand, but it's good to know that I can do that as well (I'll have to think of a clever application for it so I can try it out).

        Comment

        Working...
        X