1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    10
    Vote Rating
    0
    tomasi is on a distinguished road

      0  

    Default How to Add checkbox into TreeGrid?

    How to Add checkbox into TreeGrid?


    There is only one example about checkbox with TreePanel. But how could I put checkbox into TreeGrid? I looked at the example of treePanel. We can use tree.setCheckable(true) but not in the TreeGrid. So I tried another way. I used tree.addPlugin() to add CheckBoxSelectionModel(). It works fine, but on the top of checkbox (select all) function doesn't work? Is it a bug? Or should I try any way?

  2. #2
    Ext User
    Join Date
    Sep 2008
    Posts
    21
    Vote Rating
    0
    uozturk is on a distinguished road

      0  

    Default


    looking for the same.

    any solution?

  3. #3
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    you have a working example code?

  4. #4
    Sencha User
    Join Date
    May 2009
    Posts
    118
    Vote Rating
    0
    mtarantini is on a distinguished road

      0  

    Default


    +1

    I'm looking for the same kind of widget. A TreeGrid with chebox and the possibility to select the Cascade Behavior and the CheckNode Behavior and with the 2 methods "Expand All" & "Collapse All" which doesn't exist for the TreeGrid.

    I'have notice that the checkbox in the column model doesn't work as well when using the addPlugin() method and the CheckBoxSelectionModel

  5. #5
    Ext User
    Join Date
    Jun 2009
    Posts
    10
    Vote Rating
    0
    tomasi is on a distinguished road

      0  

    Default


    Problem solved! I used gwt 1.7 gxt 2.01 then Used TreeGrid example code that add checkBox into treeGrid by using addPlugin.Then it works. the followings are my peice of code and the result.
    Code:
             CheckBoxSelectionModel<ModelData> sm = new CheckBoxSelectionModel<ModelData>();
             Folder model = getTreeModel();
    
             TreeStore<ModelData> store = new TreeStore<ModelData>();
             store.add(model.getChildren(), true);
    
             ColumnConfig name = new ColumnConfig("name", "Name", 100);
             name.setRenderer(new TreeGridCellRenderer<ModelData>());   
             ColumnConfig date = new ColumnConfig("author", "Author", 100);     
             ColumnConfig size = new ColumnConfig("genre", "Genre", 100);
             ColumnModel cm = new ColumnModel(Arrays.asList(sm.getColumn(),name, date, size));
             TreeGrid<ModelData> tree = new TreeGrid<ModelData>(store, cm);
             tree.setBorders(true);
             tree.setSize(400, 400);
             tree.setAutoExpandColumn("name");
             tree.setTrackMouseOver(false);         
             tree.setSelectionModel(sm);
             tree.addPlugin(sm);
    Attached Images

  6. #6
    Sencha User
    Join Date
    May 2009
    Posts
    118
    Vote Rating
    0
    mtarantini is on a distinguished road

      0  

    Default


    It's a temporary workaround,

    You will not have the fonctionnalities of the TreePanel with setCheckable(true), like the CheckNode Behavior or the Cascade Behavior are the collapseall / expandall except if you implements all those fonctionnalities (which I hope GXT Team will look forward for giving us such a widget).

    But it's the solution is enough for your needs, then good for you

  7. #7
    Ext User
    Join Date
    Jun 2009
    Posts
    10
    Vote Rating
    0
    tomasi is on a distinguished road

      0  

    Default


    Quote Originally Posted by mtarantini View Post
    It's a temporary workaround,

    You will not have the fonctionnalities of the TreePanel with setCheckable(true), like the CheckNode Behavior or the Cascade Behavior are the collapseall / expandall except if you implements all those fonctionnalities (which I hope GXT Team will look forward for giving us such a widget).

    But it's the solution is enough for your needs, then good for you
    yes you're right. That's all I want for now! I also hope Gxt Team can make it better!

  8. #8
    Ext User
    Join Date
    Feb 2010
    Posts
    1
    Vote Rating
    0
    adelio.corso is on a distinguished road

      0  

    Default


    Hi guys,

    Can someone re-post this request into Gxt Feature Requests Forum - I've just registered and don't have permissions to create new threads yet.

    Would be nice to have a TreeGrid with setCheckable option enabled, like the TreePanel does.

    Thanks,
    Adelio

  9. #9
    Ext User
    Join Date
    May 2010
    Posts
    1
    Vote Rating
    0
    gaozhi is on a distinguished road

      0  

    Default


    why not treeGrid don't the same as treepanel add checked : false in it's store

  10. #10
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Quote Originally Posted by gaozhi View Post
    why not treeGrid don't the same as treepanel add checked : false in it's store
    GXT3 will have three state checkbox support in TreePanel and TreeGrid