Categories

Archives

Ext Grid rowdblclick and rowclick fix

Ext is a great javascript library but ofcourse there are times where some things doesn’t work and one of them is the rowdblclick and rowclick listener. Here is how i fixed it when i’ve encountered this problem.
var grid = new Ext.grid.GridPanel({
store: <your datastore>,
columns:[<your columns>],
renderTo:’example-grid’,
height:200,
listeners:{
rowdblclick : function(grid,row){
alert(“rowdblclick”)
},
rowclick:function(grid,row){
alert(‘rowclick’)
}
}
});
As you can see instead of doing
grid.getSelectionModel().addListener(“click”,
function(grid,row){ alert(”click’); })
or [...]