cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
terapin
Level VI

JSL to add event handler

I'm trying to add an event handler column property using the following code but it isn't working.  I can manually apply the property, but can't figure out a script based method.  Can this be done by JSL?

 

// Create hyperlink for URL column
:Current Firmware URL << Add Column Properties(
    Event Handler,
    Function( {thisTable, thisColumn, iRow},
        Web( Char( thisTable:thisColumn[iRow] ) ); // open a web page
    )
);




1 ACCEPTED SOLUTION

Accepted Solutions
Georg
Level VII

Re: JSL to add event handler

just a hint:

to solve this type of scripting tasks (add formula, add properties, add event handler),

it may always be a good way to have a working table with that properties and look into the table script

(red triangle --> copy table script), there is the code to replicate the table functionality!

Georg

View solution in original post

3 REPLIES 3
terapin
Level VI

Re: JSL to add event handler

Nevermind,

 

After locating Add Hyperlinks to Columns in the online help, I was able to locate the code to add hyperlinks as expected.  Should have known that the help manual would have had the solution.  If only I looked a little harder.

 

// Create hyperlink for URL column
:Current Firmware URLX << 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 web browser."; );)
        ),
        Color( JSL Quote(Function( {thisTable, thisColumn, iRow}, 5; );) )
    )
);
Georg
Level VII

Re: JSL to add event handler

just a hint:

to solve this type of scripting tasks (add formula, add properties, add event handler),

it may always be a good way to have a working table with that properties and look into the table script

(red triangle --> copy table script), there is the code to replicate the table functionality!

Georg
terapin
Level VI

Re: JSL to add event handler

Didn't know that feature existed. Thanks for pointing it out. That would have made the scripting process a whole lot easier.