PDA

View Full Version : TreeGrid - how to refresh only a row



marius_neo
15 Jun 2009, 7:29 AM
Hello,

I have a treegrid in which i've put on some columns checkboxes.
What i want to achieve is to have the following functionality :
- when a parent tree node gets selected also all of its children will get selected.
What i've done so far is this :


CheckColumnConfig checkColumn = new CheckColumnConfig() {
/**
* Called when the cell is clicked.
*
* @param ge
* the grid event
*/
protected void onMouseDown(GridEvent<ModelData> ge) {
int index = grid.getView().findRowIndex(ge.getTarget());
ModelData m = grid.getStore().getAt(index);

super.onMouseDown(ge);

if (m != null) {

List<ModelData> childrens = ((TreeGrid<ModelData>) grid)
.getTreeStore().getChildren(m);
for (ModelData children : childrens) {
children.set("isBlue", m.get("isBlue"));
}

((TreeGrid<ModelData>) grid).getView().refresh(false);
}


}

};



I'd like to know whether if there's a posibility to update only a tree row (or a selection of tree rows and not the whole tree grid.
I've seen there's a method in GridView class #updateRow(int) but it is protected.

Anyone has any idea on this one?