How can JSL enable the cursor to click on a cell and the same value of the other columns of the table to automatically highlight the cell?For example, use the following JSL to copy the name column of the big class two more columns.
How to use JSL: When the cursor clicks on a cell, the cell automatically sets the background to red for the same value in other columns of the table.
Thanks!
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( 1 );
dt << Select Columns( "name" );
d2 = dt << Subset( Output Table( "t" ), Selected Rows( 1 ), columns( name ) );
Column( d2, 1 ) << set name( "n1" );
dt << Sort( By( 4 ), Order( Descending ), replace table );
dt << Update( With( d2 ) );
Close( d2, nosave );
dt << Select Where( 1 );
dt << Select Columns( "name" );
d2 = dt << Subset( Output Table( "t" ), Selected Rows( 1 ), columns( name ) );
Column( d2, 1 ) << set name( "n2" );
dt << Sort( By( 5 ), Order( Descending ), replace table );
dt << Update( With( d2 ) );
Close( d2, nosave );

Automation and ScriptingRe: How can JSL enable the cursor to click on a cell and the same value of the other columns of the table to automatically highlight the cell?You'll need to add an Event Handler to :name. I think this is what you're looking for:
Function( {thisTable, thisColumn, iRow},
{},
n1rows = thisTable << Get Rows Where( :n1 == thisTable:thisColumn[iRow] );
n2rows = thisTable << Get Rows Where( :n2 == thisTable:thisColumn[iRow] );
thisTable << Select Columns( {thisColumn, :n1, :n2} ) << Clear Cell Colors;
thisColumn << Color Cells( {3, {iRow}} );
:n1 << Color Cells( {3, n1rows} );
:n2 << Color Cells( {3, n2rows} );
);Add the Column Property:

Hope that helps!
Re: How can JSL enable the cursor to click on a cell and the same value of the other columns of the table to automatically highlight the cell?Thanks!

Re: How can JSL enable the cursor to click on a cell and the same value of the other columns of the table to automatically highlight the cell?Re: How can JSL enable the cursor to click on a cell and the same value of the other columns of the table to automatically highlight the cell?Thanks!