PDA

View Full Version : Selected cell/row event problem in gird panel



yonishec
24 Oct 2007, 7:35 AM
Hi,

I have a grid that along with text data in the columns i also have hyperlinks with images.
I inseart those links by simple javascript syntax to the data array.
The links work proepry when selecting them from the grid.
So what is the problem:
I always need to know what row,cell a mouse was clicked on.
I added a cell selection model and to it added an on event to catch the cell clicked event.
It works for each cell i click on in the grid even in the columns with the hyperlinks. The problem is that if i click on an image then the click event is not fired.
I'am puzzled..... I tried many things such as using the rowselection model instead or adding to the grid itself an cellclicked event but nothing works.
This is very problematic for me becasue i use the hyperlinks to call my own java scripts and one of thing these scripts have to know is the row in which i selected the link.

PLease help me :(

RSidetrack
24 Oct 2007, 9:12 AM
Without any code I am going to go on the limb here -

It sounds like the link you have associated with the image is handling the events instead of the column selection/row selection - which is understandable.

I may recommend this - remove the link associated with the image and store the link in an additional data column which is not placed on the grid within the record. What you can do with this is when a column/row is selected, retrieve the record and the value for that "hidden" value for the link.

This way in the click handler you can handle your row/column routines and also open the window in which the link is pointed to.

Does this make sense?

yonishec
24 Oct 2007, 11:24 PM
Hi,

Your solution is used by me for another porpuse. In my grid i have a range of columns that whne i click on them and the oncell event is fired then i get from another hiiden column the url to which i want to go and show all the relevent information on the selected row.
My problem is that in one column i have 1 ro more images with hyper links.