- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Connect Column Names with String Col Box
Hi JSL Experts,
I would like to connect column names with a String Col Box with the example below. The Col List Box will update the column status (add/delete/rename) automatically which is the functionality I need for the String Col Box. So, I create a Col List Box and then connect it to the String Col Box.
It seems works, but I would like to hide the Col List Box or run it at the background. However, when I set Box1<<visibility(Hidden), then it lost the connect from the data table. Any suggestions would be greatly appreciated.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New window("Connect dt with String Col box",
Box1=Col list box(dt, all,
on change(
Cols=Box1<<get items;
Box2<<set values(Cols);
)
),
Table box(
Box2=String col box("Columns",Cols=Box1<<get items)
)
);
Best,
Tzu-Chun Wu
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Connect Column Names with String Col Box
You can subscribe to a table to detect changes - this avoids using Col List Box but is a complex route.
Perhaps you could just place the display box inside a closed outline box ?
OutlineBox("-", <<close(1),
ColListBox( ... )
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Connect Column Names with String Col Box
Not really sure what you are trying to do here. Do you really want a Col List Box or are you just using it to get a list of columns. If the later, then you can just write:
col = dt << getColumnNames(string)
where dt is a reference to a data table, for example:
dt = currentDataTable();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Connect Column Names with String Col Box
Hi Dave,
I would like to create a string col box which reflect the column change of a data table. For example, if I have columns {"Column 1", "Column 2"} and add a new column "Column 3" later, it will be great if the string column box can be updated automatically without any other actions.
dt=new table("Table",
New column("Column 1"),
New column("Column 2")
);
New window("",
Table box(
String Col box("Columns", dt<<get column names("String")),
Col List box(dt, all)
)
);
wait(1);
dt<<new column("Column 3");
The "get column names" is a good idea, but the string col box will not be updated automatically. Here is the comparison between String Col box and Col list box.
before adding column 3
After Adding Column 3
Help the details helps.
Tzu-Chun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Connect Column Names with String Col Box
You can subscribe to a table to detect changes - this avoids using Col List Box but is a complex route.
Perhaps you could just place the display box inside a closed outline box ?
OutlineBox("-", <<close(1),
ColListBox( ... )
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Connect Column Names with String Col Box
Hi Dave,
The Outline Box approach does not work, but the Subscribe function is exactly what I need. Thanks again for your suggestion and help. If someone is interested in the Subscribe function, please check the link https://www.jmp.com/support/help/14/subscribe-to-a-data-table.shtml
Tzu-Chun