cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
JSL:Selecting cols with Filter Col Selector and hot spot functionality Show Filter as "default"

I just came around a question from a customer which I found worth sharing to the scripting community and those who would like to become part of it

 

In any platform where you can select the columns to drag them into roles you have the option in these little red triangles (hot spots) to show a filter, which helps you to search for column names you are interested in. A very helpful feature if you have more variables than just a few!

 

Now let's imagine you want to build up an application using this column filter in your own window. You can open up the Scripting Index under Help -> Scripting Index and search for "col filter". "Filter Col Selector" will appear quite prominent in the first rows of the results list of commands. Well, that's a good start. There is even an example.  

 

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Col List Box Example",
	fontobj = lb = Filter Col Selector( width( 250 ) )
);

This results in this window:

 

 

Window_ColSelector.JPG

 

So far so good, but where is my filter???

What you should always remind are commands like Show Properties(), as they will show you in the log all options you have to apply to this object, in this case fontobj.

Show Properties(fontobj);

This will create a bunch of commands, however what you really want is one of the following three:

 

Name contains [Action] [Scripting Only] 
Name starts with [Action] [Scripting Only] 
Name ends with [Action] [Scripting Only] 


Another way to look out for commands to be used on Filter Col Selector is the Scripting Index, this time not searching, but looking into the category list and select Filter Col Selector. Then those actions appear in the middle of the Scripting Index Window.

 

So using one of these commands you'll get the filter right after creating the window and somehow set it as default for your Filter Col Selector Window:

 

fontobj << Name Contains (" ");

Please be aware that you need to at least enter a space, otherwise the filter won't appear. This will be the result:

 

 

Result_ColSelector.JPG

 

 

I hope you found this as valuable as I did or at least it reminded you to check out for what JMP provides you using Help or commands like Show Properties() or Show Tree Structure() and others.

Best,

Martin

 

 

 

Last Modified: Dec 21, 2023 1:33 PM
Comments