PDA

View Full Version : grid events



paserrano
25 Nov 2009, 7:41 AM
Hello

I am working with grid and I am trying to associate a lot of eventos to this grid, but only It is working: SelectionChange, the rest of them are not working. My code is like:

grid.getSelectionModel().addListener(Events.CellClick,
new Listener<SelectionChangedEvent<Patient>>() {
public void handleEvent(SelectionChangedEvent<Patient> be) {
Window.alert("CellClick click");
}
});

Patient is not extended from ModelData, maybe it's the problem? I can't associate an event to a grid whitout modeldata?

thanks

sven
25 Nov 2009, 8:41 AM
The selectionmodel is never firing a CellClick event. Only grid fires that.

paserrano
26 Nov 2009, 1:00 AM
Ok

I know about my error but....How can I associate a cell click event to a grid?

paserrano
26 Nov 2009, 1:23 AM
Ok, I solve my own problem, I copy the solution:

Listener<GridEvent<Patient>> gridListener = new Listener<GridEvent<Patient>>() {
public void handleEvent(GridEvent<Patient> be) {
EventType type = be.getType();

if (type == Events.CellDoubleClick) {
Window.alert("doubleclick");

}

}
};
grid.addListener(Events.CellDoubleClick,gridListener);