Skip to main content

Links in JMaki tables

3 replies [Last post]
btjenkins
Offline
Joined: 2008-06-19
Points: 0

Hi,

I'm trying to figure out how to display links in a JMaki table (either the dojo or Yahoo data table). I noticed that there is no mention of href links on the JMaki table data model page (http://wiki.java.net/bin/view/Projects/jMakiTableDataModel). What I'd like to do is have a table that displays a list of items, and the Title of each item is a clickable link to the webpage of that item.

Thanks,
Brian

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sonytvpm
Offline
Joined: 2009-03-13
Points: 0

instead of escape character you can use "
Example is

"a href ="javascript:
var x = " 12";
var y = "hello";
hello(x,y)"
From the above example you are passing variable as 12& hello
The above code is working in jmaki yahoo data table ".
Sony

gmurray71
Offline
Joined: 2003-07-31
Points: 0

Hi btJenkins,

Links are possible you just need to be careful with your quote escaping.

The tables all use innerHTML replacement so you can use something like:

<div jmakiName="yahoo.dataTable"
jmakiValue="{columns : [
{ label : 'Title', id : 'title'},
{ label :'Author', id : 'author'},
{ label : 'ISBN', id : 'isbn'},
{ label : 'Description', id : 'description'}
],
rows : [
{ title : 'Book Title 1', author : 'Author 1', isbn: '4412', description : '<a href=\'http://google.com\'>Google Me</a>'},
{ id : 'bar', title : 'Book Title 2', author : 'Author 2', isbn : '4412', description : 'A Some long description'}
]
}"></div>

If you are using JSON loaded from a service you can use single quotes ' and the links will be fine.

-G

sonytvpm
Offline
Joined: 2009-03-13
Points: 0

instead of escape character you can use "
Example is

test
From the above example you are passing variable as 12& hello
The above code is working in jmaki yahoo data table .
Sony