Announcement

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

    TreeGrid initial selections

    Hi,

    I create a TreeGrid and have it pre-loaded with initial data using the initialData property. One
    of the attributes from the data I supply contains the initial selection state for each item to be rendered
    in the tree grid.

    Is there any way to have that boolean property used by the framework to have the tree node's initial
    selection state reflect that property? I'm looking for something in the lines of

    Code:
     TreeGrid.create
    ({
      ...
     initialData : initialData,
     dataProperties : { selectionProperty : 'isSelected' },
     ...
    });
    Any such feature? If not, I've struggled trying to have the tree nodes selected using actual
    code and wasn't successful using that approach either ... Here's the code I used

    Code:
    var treeGrid = TreeGrid.create
    ({
    ...
    initialData : initialData,
    ...
    });
    
    for (var i = 0; i < initialData.length; ++i)
    {
         if (initialData[i].isSelected)
              treeGrid.selectRecord(initialData[i]);
    }
    
    treeGrid.markForRedraw();
    My initial data shows up but no selections show up ...

    How can this be achieved ?

    Thanking you in advance for your help,

    #2
    Hi
    I'm not sure why the programmatic 'selectRecord' calls aren't working for you - they should -- however we have a simple flag for this.
    Try setting
    Code:
        selectionProperty:"isSelected",
    On your TreeGrid.

    This is currently undocumented but is safe to use. We'll be exposing this in the near future.

    Comment


      #3
      That works. Thanks!

      I don't know why I didn't find that by myself ... I guess it was too easy! ;-)

      Thanks again,

      Comment


        #4
        By the way, I looked at the documentation (7.0 RC2) and that property isn't documented. You may want to have it added.

        Kind regards,

        Comment

        Working...
        X