Hello,
I was wondering if there was a straightforward way to add search capability to the Column Dialog form within JSL, similar to the functionality within the red triangles of all platform column selections.
My very basic code skeleton works but I would like to add the search bar:
Column Dialog(
y_col = Col List( "Y Variable", Max Col( 1 ) ),
x_col = Col List( "X Variable", Max Col( 1 ) ),
);
Thank you,
JP
how about the Filter Col Selector ?
This is an example from the scripting index -
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Filter Col Selector Example",
fontobj = lb = Filter Col Selector( width( 250 ) )
);
I'm not sure that there is an out-of-the-box method, but you can script the functionality. Here is an example:
dt = Current Data Table();
lstColNames = dt << Get Column Names(string);
New Window("Test",
Lineup Box(NCOl(1),
teb = Text Edit Box("",<<Hint("search string"),<<Set Script(DoSearch())),
clb = Col List Box()
)
);
clb << Set Items(lstColNames);
DoSearch = Function({},{Default Local},
str = teb << Get Text;
If (Trim(str)=="",
dt = Current Data Table();
lstColNames = dt << Get Column Names(string);
clb << Set Items(lstColNames);
,
lstColNames = clb << Get Items;
lstMatch = {};
For (i=1,i<=NItems(lstColNames),i++,
colName = lstColNames[i];
If (Contains(colName,str),
InsertInto(lstMatch,colName);
)
);
clb << Set Items(lstMatch);
)
);
Thank you for posting this.
Exactly what I was looking for!
Cool! But did either of you have any luck turning this into a modal window so it would really act like a dialog? Simply making the window modal makes entering something in the search box act like you hit the OK button on the window so you don't get to pick your columns.
Whilst Column Dialog is a (deprecated) modal window, if you look at the JMP interface dialogues with a user are rarely implemented using modal windows. If you need the window to be modal then the Set Items line immediately after the window definition needs to be placed inside an OnOpen event handler. Responding to the enter key during a search and preventing it being treated as an OK click would need to be handled using an OnValidate handler on the window.
how about the Filter Col Selector ?
This is an example from the scripting index -
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Filter Col Selector Example",
fontobj = lb = Filter Col Selector( width( 250 ) )
);
hi Chungwei,
this filter is very useful and is available in most platforms in JMP. is there a reason it is not built-in to the Fit model dialog? it would be very useful there.
what version of JMP are you running ?
hi ChungWei
i am using jmp 11.
in JMP 12 (or any other version it is not available)
this is out of the help documentation: the fit model just doesn't have the red triangle near the list of columns
on the other hand the fit y by x has it (and had it for many versions back)
Thanks!