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

Search the Sample Index

It would be nice to search the sample index by name.  It is possible to bring up the alphabetical list of data files and use Find, but this is not obvious to most users so opening a table always take a minute.  If the top of the Sample Index had a search field it would be immediately obvious how to quickly find a table or script by name.

3 Comments
jthi
Super User

Good idea, even I from time to time forget that Find is an option. Also Find is a bit slowish when going through collapsed outlineboxes. Below is one fairly quickly wrote late evening idea for possible implementation:

 

View more...
Names Default To Here(1);

If(Contains(Get Window List() << get window title, "Sample Index"),
	If(Contains((Window("Sample Index") << XPath("//OutlineBox")) << get title, "Search"),
		stop();
	);
,
	Main Menu("Sample Index");
);

nw = Window("Sample Index");
search_bb = Outline Box("Search", 
	Border Box(Left(0), Right(0), top(0), bottom(0), sides(15),
		V List Box(
			H List Box(
				align("center"),
				teb = Text Edit Box("",
					<<Set Min Size(100, -1),
					<<Set Max Size(450, -1),
					<<Set Auto Stretching(1, 0),
					<<Set Hint("Search...")
				),
				Button Box("", <<Set Icon("WinToolsMagnifier"),
					//this will happen automagically when this is pressed, so can be left empty
					1;
				), //might be useless,,
				Button Box("", <<Set Icon("TabCloseActive"), << Set Function(function({this},
						sib_teb = ((this << Prev Sib) << Prev Sib);
						sib_teb << Set Text("", Run Script(1));
					))
				)
			),
			vlb = V List Box()
		)
	)
);

teb << Set Function(function({this},
	vlb_search = (this << parent) << sib;
	While(!IsEmpty(vlb_search << child),
		(vlb_search << child) << Delete Box();
	);

	lubs = ((this << top parent) << XPath("//PanelBox/OutlineBox/LineUpBox"));
	lub_search = Lineup Box(N Col(4));
	For Each({lub}, lubs,
		btns = lub << XPath("//ButtonBox");
		tbs = lub << XPath("//TextBox");
		tbs = tbs[2::N Items(tbs)::2];
		For Each({{btn, tb}, idx}, Across(btns, tbs),
			btn_name = btn << Get Button Name;
			If(Contains(lowercase(btn_name) ||"¤"||lowercase(tb << get text), lowercase(this << get text)),
				lub_search << Append(btn);
				lub_search << Append(tb);
				show(btn << get button name, tb << get text);
			);
		);
	);
	vlb_search << Append(lub_search);
));

((nw[OutlineBox("About this Sample Index")]) << parent) << Prepend(search_bb);

 

jthi_1-1663619870859.png

 

SamGardner
Level VII
Status changed to: Yes, Stay Tuned!

Thanks for the suggestion @ih .  In JMP 17, we are providing a new enhanced JMP Search, where you can search almost everything in JMP, including the sample data files. It will be available under the help menu.  

mia_stephens
Staff
Status changed to: Delivered

As @SamGardner indicated, this is available via Search JMP in JMP 17. Changing this request to delivered.