<?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 Dynamic search bar on table box columns in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/886975#M104940</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A frequent request is to create a sort of search bar above the table box columns, similar to what is done in other visualization software.&lt;/P&gt;
&lt;P&gt;The aim would be to be able to very easily filter the data table on the different filters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, in my example below, if I enter "Pend" in the search box on top of column "Validation status" and "Yes"&amp;nbsp;&amp;nbsp; in the search box on top of column "Distribution confirmation" it will filter the table given these two filters: every rows that contain "Pend" in validation status and "yes" in the other column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know we could use data filter, and that what I ask is really about JSL scripting, but did anyone has the same&amp;nbsp;&amp;nbsp;had a similar request and succeeded in generalizing the function to generate this kind of tablebox ?&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="SophieCuvillier_0-1752591556019.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78248iBBFCB05ECEA17EF4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SophieCuvillier_0-1752591556019.png" alt="SophieCuvillier_0-1752591556019.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jul 2025 15:03:55 GMT</pubDate>
    <dc:creator>SophieCuvillier</dc:creator>
    <dc:date>2025-07-15T15:03:55Z</dc:date>
    <item>
      <title>Dynamic search bar on table box columns</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/886975#M104940</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A frequent request is to create a sort of search bar above the table box columns, similar to what is done in other visualization software.&lt;/P&gt;
&lt;P&gt;The aim would be to be able to very easily filter the data table on the different filters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, in my example below, if I enter "Pend" in the search box on top of column "Validation status" and "Yes"&amp;nbsp;&amp;nbsp; in the search box on top of column "Distribution confirmation" it will filter the table given these two filters: every rows that contain "Pend" in validation status and "yes" in the other column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know we could use data filter, and that what I ask is really about JSL scripting, but did anyone has the same&amp;nbsp;&amp;nbsp;had a similar request and succeeded in generalizing the function to generate this kind of tablebox ?&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="SophieCuvillier_0-1752591556019.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78248iBBFCB05ECEA17EF4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SophieCuvillier_0-1752591556019.png" alt="SophieCuvillier_0-1752591556019.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2025 15:03:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/886975#M104940</guid>
      <dc:creator>SophieCuvillier</dc:creator>
      <dc:date>2025-07-15T15:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic search bar on table box columns</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887027#M104941</link>
      <description>&lt;P&gt;This is already an entry in the JMP Wish List.&amp;nbsp; You can view it&amp;nbsp;&lt;A href="https://community.jmp.com/t5/JMP-Wish-List/Column-Filters/idi-p/584907" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2025 15:27:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887027#M104941</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-07-15T15:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic search bar on table box columns</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887290#M104942</link>
      <description>&lt;P&gt;It isn't too complicated to create basic version of something like this but creating a robust and nice looking one will most likely get somewhat complicated. Example below is on the basic side&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

filter_tablebox = function({tb, options}, 
	aa = Associative Array(tb &amp;lt;&amp;lt; get names, options &amp;lt;&amp;lt; get text);
	filter_expr = {};
	For Each({{colname, filter_text}}, aa,
		If(Is Missing(filter_text),
			continue(); // skip over
		);
		Insert Into(filter_expr, EvalExpr(Contains(Lowercase(Expr(As Name(colname))), Expr(filter_text))));
	);
	
	If(N Items(filter_expr) == 0,
		tb &amp;lt;&amp;lt; Reset Filter;
		return(1);
	);
	If(N Items(filter_expr) == 1,
		filter_expr = filter_expr[1];
	,
		Substitute Into(filter_expr, Expr(List()), Expr(And()));
	);

	Eval(EvalExpr(tb &amp;lt;&amp;lt; Filter Where(Expr(Name Expr(filter_expr)))));
	
	return(1);
);

nw = New Window("Example",
	ob = Outline Box("Table",
		V List Box(
			hlb = H List Box(
				Text Edit Box("", &amp;lt;&amp;lt; Set Script(filter_tablebox(tb1, hlb &amp;lt;&amp;lt; XPath("//TextEditBox"))), &amp;lt;&amp;lt; Set Width(51)),
				Text Edit Box("", &amp;lt;&amp;lt; Set Script(filter_tablebox(tb1, hlb &amp;lt;&amp;lt; XPath("//TextEditBox"))), &amp;lt;&amp;lt; Set Width(80)),
			),
			tb1 = Table Box(
				String Col Box("Mountain", {"K2", "Delphi", "Kilimanjaro", "Grand Teton"}),
				String Col Box("TEST", {"x", "y", "z", "a"})
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2025 18:34:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887290#M104942</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-07-15T18:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic search bar on table box columns</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887383#M104949</link>
      <description>&lt;P&gt;Thank you very much, that's exactly it! The basic version already solves my problem, it's perfect.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 07:24:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887383#M104949</guid>
      <dc:creator>SophieCuvillier</dc:creator>
      <dc:date>2025-07-16T07:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic search bar on table box columns</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887657#M104978</link>
      <description>&lt;P&gt;Just by curiosity, would it be possible to work also with a data table box ?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 09:49:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887657#M104978</guid>
      <dc:creator>SophieCuvillier</dc:creator>
      <dc:date>2025-07-17T09:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic search bar on table box columns</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887659#M104979</link>
      <description>&lt;P&gt;If Table Box is using Data Table Col Boxes it doesn't seem to support Filter Where anymore which would prevent you from using this. What is the reasoning for using Data Table Box? Do you wish to have the capability of row selection which is linked to the original table or something else?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 10:06:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887659#M104979</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-07-17T10:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic search bar on table box columns</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887676#M104981</link>
      <description>&lt;P&gt;It's just that with the data table box, I had the data table directly, whereas with the table box, I had to convert my table into a table box. And indeed I had tried to adjust your script for data table but I got stuck on the filter where I didn't know if it was me who was doing it wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 11:48:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887676#M104981</guid>
      <dc:creator>SophieCuvillier</dc:creator>
      <dc:date>2025-07-17T11:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic search bar on table box columns</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887689#M104982</link>
      <description>&lt;P&gt;You can convert data table to table box (without fancy data table col boxes) using &amp;lt;&amp;lt; get as report&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(4),
	Compress File When Saved(1),
	New Column("Mountain",
		Character,
		"Nominal",
		Set Values({"K2", "Delphi", "Kilimanjaro", "Grand Teton"})
	),
	New Column("TEST", Character, "Nominal", Set Values({"x", "y", "z", "a"}))
);


filter_tablebox = function({tb, options}, 
	aa = Associative Array(tb &amp;lt;&amp;lt; get names, options &amp;lt;&amp;lt; get text);
	filter_expr = {};
	For Each({{colname, filter_text}}, aa,
		If(Is Missing(filter_text),
			continue(); // skip over
		);
		Insert Into(filter_expr, EvalExpr(Contains(Lowercase(Expr(As Name(colname))), Expr(filter_text))));
	);
	
	If(N Items(filter_expr) == 0,
		tb &amp;lt;&amp;lt; Reset Filter;
		return(1);
	);
	If(N Items(filter_expr) == 1,
		filter_expr = filter_expr[1];
	,
		Substitute Into(filter_expr, Expr(List()), Expr(And()));
	);

	Eval(EvalExpr(tb &amp;lt;&amp;lt; Filter Where(Expr(Name Expr(filter_expr)))));
	
	return(1);
);

nw = New Window("Example",
	ob = Outline Box("Table",
		V List Box(
			hlb = H List Box(
				Text Edit Box("", &amp;lt;&amp;lt; Set Script(filter_tablebox(tb1, hlb &amp;lt;&amp;lt; XPath("//TextEditBox"))), &amp;lt;&amp;lt; Set Width(80)),
				Text Edit Box("", &amp;lt;&amp;lt; Set Script(filter_tablebox(tb1, hlb &amp;lt;&amp;lt; XPath("//TextEditBox"))), &amp;lt;&amp;lt; Set Width(51)),
			),
			rep = dt &amp;lt;&amp;lt; get as report; // repo is border box and under it is table box
		)
	)
);

tb1 = rep &amp;lt;&amp;lt; child;
rep &amp;lt;&amp;lt; Left (0);
rep &amp;lt;&amp;lt; Top(0);
rep &amp;lt;&amp;lt; Bottom(0);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jul 2025 11:57:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887689#M104982</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-07-17T11:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic search bar on table box columns</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887690#M104983</link>
      <description>&lt;P&gt;Thank you very much !!!!!&amp;nbsp; I had no idea it was so simple as a get as report to convert it!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 12:04:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-search-bar-on-table-box-columns/m-p/887690#M104983</guid>
      <dc:creator>SophieCuvillier</dc:creator>
      <dc:date>2025-07-17T12:04:05Z</dc:date>
    </item>
  </channel>
</rss>

