Announcement

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

    How set a node as select by default in a TreeGrid ?

    I'm using smartgwt 2.2,
    I've a TreeGrid object which uses a serverside datasourde to load data:

    Code:
    final TreeGrid treeGrid = new TreeGrid();
    treeGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX); 
    treeGrid.setAutoFetchData(true);
    treeGrid.setLoadDataOnDemand(false);
    treeGrid.setDataSource(new TreeGridDataSource());
    TreeGridDataSource extends GwtRpcDataSource & loads all tree nodes data at first fetch operation .
    My TreeGrid involves a checkbox for each row, & in my datasource I've a boolean field which I want to use it to check some nodes automatically when TreeGrid loads .
    Any Idea ?
    Last edited by ehsankh; 27 Aug 2010, 01:41.

    #2
    setSelectionProperty

    Code:
    treeGrid.setSelectionProperty("myBooleanField");
    I was using a String field and found that supplying the field in the JSON data makes it true and not supplying it makes it false.

    Comment

    Working...
    X