:: Forum >>

How to get the index of a cell on dblClick Event

Hi,

if i make a doubleclick on a cell in the Grid i want to have the row-index and the column-index of this cell rerturned. How can i get it?

All i found in this forum did not help me.
Nick
Thursday, July 21, 2005

The value for "row" is correct, but the value for "col" is "undefine"

What's wrong with this code

function fctOpenX(src){
row = src.getRowProperty('index');
col = src.getColumnProperty('index');
alert("Row: " + row + "Col: "+col);
}

row.setEvent("ondblclick", function(){this.action('myAction')});
obj.setAction('myAction', fctOpenX);
Nick
Thursday, July 21, 2005
I ran into the same problem. What's the fix?
Steve
Thursday, August 18, 2005
The problem is, that you do not get the index of the column on the dblClick-Event, but you get it on the click-Event. I've read in this forum that this way can't work, but it works fine for me. Just try it.

var varSelCol=0;
var varSelRow=0;

function fctOpen(){
alert(varSelRow);
alert(varSelCol);
}

obj.setAction('click', function(src){
varSelCol = src.getColumnProperty('index');
varSelRow = src.getRowProperty('index');
});

obj.setEvent('ondblclick', function(event, src){fctOpen()});
Nick
Friday, August 19, 2005
It works and it doesnt work ! :)

If I load the page and double click on a row it does ~nothing~.

If I load the page click on a header to sort by that, THEN double click on a row it works!

Can any why explain why?
yamyam
Friday, December 30, 2005
It works, MAY BAD!

Here is why I needed to click on header to make it work:

I displaied the gird
document.write(obj);

then I added the above code to add double click event, but the grid is already displaied so by just refreshing it

obj.refresh();

or moving the setEvent code before displaying the grid solved the problem.

clicking on the header was doing nothing other that refreshing the grid.


yamyam
Friday, December 30, 2005

This topic is archived.


Back to support forum

Forum search