<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic 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? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-can-JSL-enable-the-cursor-to-click-on-a-cell-and-the-same/m-p/670166#M85812</link>
    <description>&lt;P&gt;For example, use the following JSL to copy the name column of the big class two more columns.&lt;BR /&gt;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.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt &amp;lt;&amp;lt; Select Where( 1 );
dt &amp;lt;&amp;lt; Select Columns( "name" );
d2 = dt &amp;lt;&amp;lt; Subset( Output Table( "t" ), Selected Rows( 1 ), columns( name ) );
Column( d2, 1 ) &amp;lt;&amp;lt; set name( "n1" );
dt &amp;lt;&amp;lt; Sort( By( 4 ), Order( Descending ), replace table );
dt &amp;lt;&amp;lt; Update( With( d2 ) );
Close( d2, nosave );
dt &amp;lt;&amp;lt; Select Where( 1 );
dt &amp;lt;&amp;lt; Select Columns( "name" );
d2 = dt &amp;lt;&amp;lt; Subset( Output Table( "t" ), Selected Rows( 1 ), columns( name ) );
Column( d2, 1 ) &amp;lt;&amp;lt; set name( "n2" );
dt &amp;lt;&amp;lt; Sort( By( 5 ), Order( Descending ), replace table );
dt &amp;lt;&amp;lt; Update( With( d2 ) );
Close( d2, nosave );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-08-22_21-42-38.png" style="width: 773px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55908iDDBFED131936F601/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-08-22_21-42-38.png" alt="2023-08-22_21-42-38.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2023 13:51:18 GMT</pubDate>
    <dc:creator>lala</dc:creator>
    <dc:date>2023-08-22T13:51:18Z</dc:date>
    <item>
      <title>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?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-JSL-enable-the-cursor-to-click-on-a-cell-and-the-same/m-p/670166#M85812</link>
      <description>&lt;P&gt;For example, use the following JSL to copy the name column of the big class two more columns.&lt;BR /&gt;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.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt &amp;lt;&amp;lt; Select Where( 1 );
dt &amp;lt;&amp;lt; Select Columns( "name" );
d2 = dt &amp;lt;&amp;lt; Subset( Output Table( "t" ), Selected Rows( 1 ), columns( name ) );
Column( d2, 1 ) &amp;lt;&amp;lt; set name( "n1" );
dt &amp;lt;&amp;lt; Sort( By( 4 ), Order( Descending ), replace table );
dt &amp;lt;&amp;lt; Update( With( d2 ) );
Close( d2, nosave );
dt &amp;lt;&amp;lt; Select Where( 1 );
dt &amp;lt;&amp;lt; Select Columns( "name" );
d2 = dt &amp;lt;&amp;lt; Subset( Output Table( "t" ), Selected Rows( 1 ), columns( name ) );
Column( d2, 1 ) &amp;lt;&amp;lt; set name( "n2" );
dt &amp;lt;&amp;lt; Sort( By( 5 ), Order( Descending ), replace table );
dt &amp;lt;&amp;lt; Update( With( d2 ) );
Close( d2, nosave );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-08-22_21-42-38.png" style="width: 773px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55908iDDBFED131936F601/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-08-22_21-42-38.png" alt="2023-08-22_21-42-38.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 13:51:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-JSL-enable-the-cursor-to-click-on-a-cell-and-the-same/m-p/670166#M85812</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-08-22T13:51:18Z</dc:date>
    </item>
    <item>
      <title>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?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-JSL-enable-the-cursor-to-click-on-a-cell-and-the-same/m-p/670238#M85816</link>
      <description>&lt;P&gt;You'll need to add an Event Handler to :name.&amp;nbsp; I think this is what you're looking for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Function( {thisTable, thisColumn, iRow},
	{},
	n1rows = thisTable &amp;lt;&amp;lt; Get Rows Where( :n1 == thisTable:thisColumn[iRow] );
	n2rows = thisTable &amp;lt;&amp;lt; Get Rows Where( :n2 == thisTable:thisColumn[iRow] );
	thisTable &amp;lt;&amp;lt; Select Columns( {thisColumn, :n1, :n2} ) &amp;lt;&amp;lt; Clear Cell Colors;
	thisColumn &amp;lt;&amp;lt; Color Cells( {3, {iRow}} );
	:n1 &amp;lt;&amp;lt; Color Cells( {3, n1rows} );
	:n2 &amp;lt;&amp;lt; Color Cells( {3, n2rows} );
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Add the Column Property:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mmarchandTSI_0-1692715894254.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55910iFFCD040320A08250/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mmarchandTSI_0-1692715894254.png" alt="mmarchandTSI_0-1692715894254.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 14:51:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-JSL-enable-the-cursor-to-click-on-a-cell-and-the-same/m-p/670238#M85816</guid>
      <dc:creator>mmarchandTSI</dc:creator>
      <dc:date>2023-08-22T14:51:46Z</dc:date>
    </item>
    <item>
      <title>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?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-JSL-enable-the-cursor-to-click-on-a-cell-and-the-same/m-p/670383#M85834</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;How can I remove the color from the first click?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-08-23_07-40-57.png" style="width: 556px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55930i9C8055517DA2C8AA/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-08-23_07-40-57.png" alt="2023-08-23_07-40-57.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 23:42:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-JSL-enable-the-cursor-to-click-on-a-cell-and-the-same/m-p/670383#M85834</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-08-22T23:42:56Z</dc:date>
    </item>
    <item>
      <title>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?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-JSL-enable-the-cursor-to-click-on-a-cell-and-the-same/m-p/670385#M85835</link>
      <description>&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;15 version of the new click, the last color can be automatically eliminated&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;Thanks!&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 22 Aug 2023 23:54:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-JSL-enable-the-cursor-to-click-on-a-cell-and-the-same/m-p/670385#M85835</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-08-22T23:54:26Z</dc:date>
    </item>
    <item>
      <title>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?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-JSL-enable-the-cursor-to-click-on-a-cell-and-the-same/m-p/671321#M85928</link>
      <description>&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;How do I use JSL to automatically write this code to the properties of the name column?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 06:54:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-JSL-enable-the-cursor-to-click-on-a-cell-and-the-same/m-p/671321#M85928</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-08-25T06:54:37Z</dc:date>
    </item>
  </channel>
</rss>

