Forum


Hi,
I am trying to get the index of the cell in jqGrid that has been clicked on. I have tried all variations on using index() and get() and parent(), I can't seem to work out how to return the index of the click cell.
I have the following which picks up the doubleclick:
#list is the id of the grid body table.
$("#list").dblclick(function(e){
// return the index of the target cell in the table
var index = $(e.target).index(this);
alert(index); // this just returns -1
});
Any ideas how I can get the index of the clicked cell within the grid.
Cheers,
Dave
09:06

Moderators
30/10/2007

Hello Dave
Use onCellSelect event - see the docs. Also I expect some problems in IE in case you have a hidden coulnm.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Thanks Tony, but on this occasion I need to use an external dblclick handler because I am already using onSelectRow and onDblClickRow to enter inline editing mode.
When the user double clicks on certain cells a thickbox opens containing related info to the content of the clicked cell. I need to know the index so I can grab the corresponding header to work out which thickbox content to load.
Cheers,
Dave
Most Users Ever Online: 715
Currently Online:
39 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66