PDA

View Full Version : double click on EditorGridPanel's row



lormitto
28 Feb 2010, 1:43 AM
Hi,

while trying to resolve single click on row to show another window everything works perfectly

However I do not know how to turn following code to double click solution:



selModel: new Ext.grid.RowSelectionModel({
singleSelect:true,
listeners:{
rowselect: {
fn: function(sm,index,record){
soneWindow.show();
}
}
}
}

Does not matter if I change singleSelect to false or not. Could you please advise what to do to handle issue like this?


Thank you

fay
28 Feb 2010, 2:52 AM
If you read the docs for EditorGridPanel (http://www.extjs.com/deploy/dev/docs/?class=Ext.grid.EditorGridPanel) you'll see that it has a "rowdblclick" event that you can respond to.

lormitto
28 Feb 2010, 4:34 AM
If you read the docs for EditorGridPanel (http://www.extjs.com/deploy/dev/docs/?class=Ext.grid.EditorGridPanel) you'll see that it has a "rowdblclick" event that you can respond to.

Thank you for answering. I must admit that double thinking would prevent me from asking sometimes on forum.

Could you please taka a look at code and advise what i do wrong?





selModel: new Ext.grid.RowSelectionModel({
singleSelect:false,
listeners:{

rowdblclick: function(grid, rowIndex, e) { alert("double click on row " + rowIndex); }

}
})



I am not sure why it does not work.

lormitto
28 Feb 2010, 4:36 AM
Thank you for answering.

Could you please taka a look at code:


selModel: new Ext.grid.RowSelectionModel({
singleSelect:false,
listeners:{

rowdblclick: function(grid, rowIndex, e) { alert("double click on row " + rowIndex); }

}
})

It does not work and i can't say why.

lormitto
28 Feb 2010, 6:07 AM
i sort it out

thank you a lot


however...


Could you please advise me how to get one of the fields in rowdblclick to function?

Before it was easy:

rowselect: {
fn: function(sm,index,record){
Ext.Msg.alert('text here ',record.data.id);}
}

but now


listeners:{ rowdblclick: function(grid, rowIndex, e) { Ext.Msg.alert("double click on row " + rowIndex +" "); }}



??


Thanks

lormitto
28 Feb 2010, 6:22 AM
Could you please advise me how to get one of the fields in rowdblclick to function?

Before it was easy:

rowselect: {
fn: function(sm,index,record){
Ext.Msg.alert('text here ',record.data.id);}
}

but now


listeners:{ rowdblclick: function(grid, rowIndex, e) { Ext.Msg.alert("double click on row " + rowIndex +" "); }}



??


Thanks

fay
4 Mar 2010, 9:02 AM
listeners:{
rowdblclick: function(grid, rowIndex, e)
{
var r = grid.getStore().getAt(rowIndex);
// Ext.Msg.alert('text here ', r.data.id);
}
}