PDA

View Full Version : GridPanel UP and DOWN keys navigation



ajay.kumar2
25 Jan 2011, 8:54 AM
Hi,

In a GridPanel the UP and DOWN keys take me to the next and previous record respectively.
I need to invoke a function at the UP and DOWN keys.

i tried with the following code but didn't work.



'afterrender':{
fn:function(thisCmp){
//No afterrender event defined
var myKeyMap= new Ext.KeyMap(thisCmp.getEl(),
[
{
key: Ext.EventObject.UP,
fn: function(){

alert('UP');

}
]
}

25 Jan 2011, 11:29 AM
GridPanel already does this.

ajay.kumar2
25 Jan 2011, 12:52 PM
GridPanel already does this.

Hi,

I need to invoke some other function on UP and DOWN arrow keys as well as the existing functionality(the up and down navigation in gridpanel).

Is there a way i can override UP and DOWN events?

25 Jan 2011, 12:57 PM
look at the gridview code.

ajay.kumar2
26 Jan 2011, 1:03 PM
I was able to achieve this using sm property in GridPanel and the 'beforerowselect' event of RowSelectionModel


new Ext.grid.RowSelectionModel(
{
listeners:{
'beforerowselect' :function(selModel,rowIndex,keepExisting,record){

}

thanks Garcia.