PDA

View Full Version : Double Click on Cell Event



lukefowell89
4 Jan 2011, 8:42 AM
I want to be able to run a method when a cell is double clicked on. I can see "cellselect" in CellSelectionModel which I am using. I can also see, "dblclick" in GridPanel.

What I am trying to achieve is similar to the EditorGridPanel, but I am doing things differently and I have to use a GridPanel. Any suggestions?

lukefowell89
4 Jan 2011, 8:47 AM
Oh and the reason I am posting is because celldblclick doesnt seem to work!

lukefowell89
5 Jan 2011, 1:10 AM
Anyone?

fay
5 Jan 2011, 3:29 AM
Are you sure that celldblclick is not working on GridPanel?

I just changed the array-grid example to use a CellSelectionModel and added a celldblclick event handler to the grid and it worked as expected. (Note, this was on ExtJS 3.2.1)

Try it yourself in array-grid.js:



...

var grid = ...
store: store,
sm: new Ext.grid.CellSelectionModel(),
...
});

grid.on('celldblclick', function(g, rowIndex, colIndex, e)
{
console.log(colIndex);
});

lukefowell89
6 Jan 2011, 1:12 AM
THanks for reply, i figured it out in the end. The project I am working on is getting quite large now, and the problem was to do with z-index's of components on the screen. It was unusual because the grid selected fine, but wouldnt register an events on the actual grid part. I changed the z-index from 19000 to 20001 and it works fine now.