PDA

View Full Version : How to select a row by pressing on a space key ?



xavxav
18 Nov 2010, 9:37 AM
Hi,

I have to modify the behavior of a EditorGridPanel. When the user presses on the space key, the row must be selected or deselected.
I added a new listener :


listeners: {
keypress: function(e) {
if(e.getKey()==e.SPACE) {
// TODO : select a row.
}
}
}
I can not get the row number because the only input parameter is an event.
I have tried to get the target row by this statement :

var target = e.getTarget();
var row = this.getView().findRowIndex(target);
The problem is that the row is not found.

I am a newbee with Ext-JS. Some help would be appreciated.

Regards,

Xavier