Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Using onclick instead of <A HREF=....
spw
Member

Posts: 44
Registered: 12/8/2005
Location: Australia
Member Is Offline
posted on 1/10/2006 at 03:17 AM Reply With Quote
Using onclick instead of <A HREF=....


Just started using the products and while the documentation is sometimes a little cryptic, the product is great and the Forum is full of good ideas.. Here is my contribution (similar to another one but with more explanation).

I did not want to use embedded HTML as this mean that users would have to click on a specific column to activate a link. The onclick function works well as follows:

CONTENT.JS
----------------
var TABLE_CONTENT = [
["ac", "Allan", "Clarke", "Singer/composer", "The Hollies", "1998, July"], ... etc
// Note that column 0 contains a key - this is actually the src file without the ".html" extension

TEMPLATE.JS
-----------------
The following inserted (as you will see before and immediately after the TABLE_LOOK declaration:

// row click function for spawing data views - gets src from key value in col 0
function row_clck(marked_all, marked_one) {
window.location = marked_one+".html"; //adds .html extension
}

// structure that describes visual aspects of the table
var TABLE_LOOK = {

// select column zero for key value and pass with onclick function
'key': 0, // field column to use as 'marked_one'
'onclick': row_clck, // function to be called when a row is clicked// 0 - caption,


SIMPLE - and it WORKS SO WELL!!!!!!!
View User's Profile View All Posts By User U2U Member
spw
Member

Posts: 44
Registered: 12/8/2005
Location: Australia
Member Is Offline
posted on 1/16/2006 at 06:45 AM Reply With Quote

Follow-up coments: I am now using the same table in htree different sections of the site and using the onclick function each time to extract the key vale and add to it extensions that point to different files that suit the section of the site . For example in the main page I use the value to redirect users to an information page:

// onclick funtion for spawing links to interviews
function row_clck(marked_all, marked_one) {
window.location = "int_"+marked_one+".html";
}

In another section i point to a related graphic:

// onclick funtion for spawing links to interview graphics
function row_clck(marked_all, marked_one) {
window.location = "images/art_"+marked_one+".jpg";
}

And finally I also point to related sound files:

// onclick funtion for spawing links to sound bites
function row_clck(marked_all, marked_one) {
window.location = "audio/sb_"+marked_one+".mp3";
}

The secret is that there are THREE template.js files and each page points to "its own" template.js

VERY VERSATILE!
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Simple
XP-styled
3D designed
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004