Board Logo

Making data in cell a hyperlink
darkromz - 11/17/2005 at 03:37 PM

I would like to make say all the results in the 1st cell hyperlinks, so when one is clicked it can open another window carrying over a value from that link into the next screen which will then display other information.


rblackmond - 11/17/2005 at 10:26 PM

I have the same need. I guess the OnClick would be used, but there's no examples in the manual or demo files showing how to use it. I'm very green with JavaScript so I work best by example. Thanks.


rblackmond - 11/17/2005 at 10:54 PM

Aha! I did find reference to the OnClick handling in the manual!

http://www.softcomplex.com/products/tigra_tables_pro/docs/#handling

I haven't read it thoroughly yet, but hopefully this will provide the solution.


darkromz - 11/18/2005 at 10:26 AM

Quote:
Originally posted by rblackmond
I have the same need. I guess the OnClick would be used, but there's no examples in the manual or demo files showing how to use it. I'm very green with JavaScript so I work best by example. Thanks.


I am pretty much the same, work by examples... I will have a look at the tutorial a bit later on, if i find out how to do it, i will post it here..


darkromz - 11/18/2005 at 04:45 PM

ok, this is how i am doing a hyper link within a cell at the moment.

The current, content file holds the data like so....

Quote:

// table data
var TABLE_CONTENT = [
['these are', 'top', 'frozen', 'cells']
];



Here i have just simply placed the code for a link in the same place as the value data which is going to be displaced in the 2nd cell, thus making it a hyperlink

Quote:

// table data
var TABLE_CONTENT = [
['these are', '<a href="linkhere">top</a>', 'frozen', 'cells']
];



All my data is held in a access database at the moment, so i just have a small script which generates the lines as above.


rblackmond - 11/18/2005 at 05:57 PM

I used an Onclick function. In the template.js file I added the following code:

function row_clck(marked_all, marked_one) {
window.location = "lookup.php?unit="+marked_one;
}
// structure that describes visual aspects of the table
var TABLE_LOOK = {
'key': 0, // field column to use as 'marked_one'
'onclick': row_clck, // function to be called when a row is clicked

I considered your method, but I really just needed one link for each row and I didn't care which column they clicked on so this seemed the better choice for that. :)


spw - 1/16/2006 at 06:29 AM

I have also used onclick - see my example entitled
"Using onclick instead of <A HREF=.... "


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/