20 Jul 2009 9:17 PM #1
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?
25 Jul 2009 10:28 PM #2
5 Aug 2009 8:21 AM #3
you have a working example code?
11 Aug 2009 6:13 AM #4
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
11 Aug 2009 5:47 PM #5
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.
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);
11 Aug 2009 11:03 PM #6
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
12 Aug 2009 12:16 AM #7
17 Feb 2010 2:24 PM #8
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.
6 Jun 2010 11:29 PM #9
why not treeGrid don't the same as treepanel add checked : false in it's store
7 Jun 2010 6:25 AM #10