PDA

View Full Version : [CLOSED] [GXT 2.0-M1] Grid & CheckBoxSelectionModel



Tarteens
7 May 2009, 4:31 AM
Hi everyone,

Here's my problem, I have a Grid with a CheckBoxSelectionModel :

http://images0.hiboox.com/vignettes/1909/4ff6dc56558bc799b7b75bd679727fa6.png (http://www.hiboox.fr/go/images/informatique/example,4ff6dc56558bc799b7b75bd679727fa6.png.html)

The Behavior I want is :

1) When you click on the checkbox, it select / deselect the row (it does)

2) When you have an selection, and you click on the label, it doesn't deselect all the other row, but it just deselect the row you clicked on.

In fact, I just want to know if where is a way to distinguish if the click is on the checkbox or on the label.

Thx for your help.

Rvanlaak
7 May 2009, 4:39 AM
And what is the bug?

The sollution might be to use the same Store

sven
7 May 2009, 4:47 AM
This is not really a bug. You can define your own CheckBoxSelectionModel to do that.

vachoh
3 Apr 2011, 8:14 AM
Maybe someone still needs this :

class CustomCheckBoxSelectionModel<M extends YourObject> extends CheckBoxSelectionModel<M>{
@Override
protected void handleMouseClick(GridEvent<M> e)
{
if (e.getTarget().getClassName().equals("x-grid3-row-checker")) {
// clicked on the checkbox
}
}

@Override
protected void handleMouseDown(GridEvent<M> e){
if (e.getTarget().getClassName().equals("x-grid3-row-checker")){
// clicked on the checkbox
}
}
}