Use the Event Handler column property to build hyperlinks based on one or more columns in your data table. This example shows how the hyperlinks in the SAS Offices.jmp sample data table were created.
1.
|
2.
|
Function( {thisTable, thisColumn, iRow},
Web( "https://www.google.com/maps/@"||Char(thisTable:latitude[irow])||","||Char(thisTable:longitude[irow])||",12z" ) );
–
|
thisTable is the data table object.
|
–
|
thisColumn is the column object.
|
–
|
iRow is the index of the row in thisColumn.
|
–
|
Web opens the URL in the default browser.
|
–
|
The @ sign in "https://www.google.com/maps/@" is specific to the Google API for maps. Google expects coordinates to follow it.
|
–
|
||Char(thisTable:latitude[irow]) concatenates the latitude defined in the Latitude column.
|
–
|
||","||Char(thisTable:longitude[irow])|| concatenates the longitude defined in the Longitude column.
|
–
|
The Google API uses ",12z" to specify a zoom factor.
|
See JMP Colors for a diagram of JMP colors.
New Table( "Wildlife",
New Column( "Column 1", Character, "Nominal",
Set Property( "Event Handler",
Event Handler(
Click( JSL Quote(Function( {thisTable, thisColumn, iRow}, Open( Char(
thisTable:thisColumn[ iRow ] ) ); );) ),
Tip( JSL Quote(Function( {thisTable, thisColumn, iRow}, "Open " || Char(
thisTable:thisColumn[ iRow ] ) || " in a media player."; );) ),
Color( JSL Quote(Function( {thisTable, thisColumn, iRow}, 5; );) )
)
),
Set Selected,
Set Values( {
"C:\Users\Public\Videos\Sample Videos\Wildlife.wmv",
"C:\Users\Public\Music\Sample Music\Kalimba.mp3"
} )
)
)
The SAS Country Office and Photo columns in SAS Offices.jmp also contain examples of Event Handler scripts.