3.2.0

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
July 21,

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
July 21,
I ran into the same problem. What's the fix?
Steve
August 18,
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
August 19,
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
December 30,
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
December 30,

This topic is archived.

See also:


Back to support forum