Hybrid View

  1. #1
    Ext GWT Premium Member
    Join Date
    Dec 2010
    Location
    Washington, D.C.
    Posts
    6
    Vote Rating
    0
    dhphuoc is on a distinguished road

      0  

    Default Checkbox TreeGrid

    Checkbox TreeGrid


    If you have a need to use a checkbox TreeGrid that works similarly as the TreePanel, and can't wait for the GXT v3.0, you may want to consider the attached custom TreeGrid. I am not aware of any issues with it at this time. You would use the CheckboxTreeGrid as you normally would with a TreeGrid, with the following difference configuration for the first column that contains the check boxes.

    Code:
    ColumnConfig name = new ColumnConfig("name", "Name", 300);
    name.setRenderer(new CheckboxTreeGridCellRenderer<ModelData>(true));
    Thanks,
    Phil
    Attached Files

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    23
    Vote Rating
    0
    jonas sabu is on a distinguished road

      0  

    Default No checkboxes shown

    No checkboxes shown


    Hey,

    I used your CheckBoxTreeGrid and it compiles and runs without errors.
    The problem is that it doesn't show any checkboxes...

    I do :

    ColumnConfig name = new ColumnConfig("name", "Name", 100);
    name.setRenderer(new CheckboxTreeGridCellRenderer<ModelData>());
    ColumnModel cm = new ColumnModel(columns);

    CheckboxTreeGrid<ModelData> tree = new CheckboxTreeGrid<ModelData>(store, cm);

    Do i have to do anything else to show the checkboxes? Like in TreePanel we do .setCheckable(true) or something..

  3. #3
    Ext GWT Premium Member
    Join Date
    Dec 2010
    Location
    Washington, D.C.
    Posts
    6
    Vote Rating
    0
    dhphuoc is on a distinguished road

      0  

    Default


    Yes, you need to pass "true" to the renderer constructor:
    name.setRenderer(new CheckboxTreeGridCellRenderer<ModelData>(true));

    Phil

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    23
    Vote Rating
    0
    jonas sabu is on a distinguished road

      0  

    Default Works now :)

    Works now :)


    Thanks alot, that was the problem.
    You know if is it possible to add a checkbox to the grid's columns to select all the elements?

  5. #5
    Ext GWT Premium Member
    Join Date
    Dec 2010
    Location
    Washington, D.C.
    Posts
    6
    Vote Rating
    0
    dhphuoc is on a distinguished road

      0  

    Default


    Right now the checkbox tree grid follows the same cascade behaviors in a TreePanel, i.e. if you check a root node, all child nodes will be checked. So you may consider this feature as you build your tree store. Other than that, I don't know if what you are looking to do is possible or if it should be done that way. Good luck.

    Phil

  6. #6
    Sencha User
    Join Date
    Mar 2011
    Posts
    22
    Vote Rating
    0
    denu is on a distinguished road

      0  

    Default widgets

    widgets


    Great work with the Checkboxes! Is there a way to set any other column renderer to return Widget?

    greetz

Similar Threads

  1. treegrid checkbox extension
    By yd290276 in forum Ext 3.x: User Extensions and Plugins
    Replies: 7
    Last Post: 13 Jan 2012, 12:22 PM
  2. TreeGrid with checkbox functionality
    By dhphuoc in forum Ext GWT: Discussion
    Replies: 3
    Last Post: 7 Sep 2011, 7:53 AM
  3. How to Add checkbox into TreeGrid?
    By tomasi in forum Ext GWT: Discussion
    Replies: 9
    Last Post: 7 Jun 2010, 6:25 AM
  4. Rendering checkbox in treegrid
    By jazzer in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 5 Apr 2010, 7:13 AM

Thread Participants: 4

Tags for this Thread