Subscribe Bookmark RSS Feed

Column Dialog Box Question

dlee0416

Community Trekker

Joined:

Jun 11, 2014

I'm hoping there's a simple answer to this question that been evading me...  I frequently use the Column Dialog Box that allows a user to specify specific columns for user in subsequent analyses.  Is there a way to have a default list of columns automatically appear as selected.  For example, I'm using the Diamonds dataset and would like to run the script and have 'Color' and 'Clarity' automatically show up as selected.  The users could then add to and/or delete from this default list to customize analyses. 

11031_pastedImage_0.png

PS: Please ignore the dialog at the bottom o f the window  - it's just nonsense carryover that I need to clean up. 

3 REPLIES
ian_jmp

Staff

Joined:

Jun 23, 2011

Something like this, perhaps (I didn't bother to put buttons in the UI)?

NamesDefaultToHere(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

nw = NewWindow("Dialog",

HListBox(

source = ColListBox(dt, all),

destination = ColListBox()

)

);

Wait(2);

destination << setItems({:height, :weight});

txnelson

Super User

Joined:

Jun 22, 2012

I use the following code to select in the Col List Box, all of the columns that are currently selected in the data table.  It might prove useful

colListData = Col List Box( nLines( 15 ) ),

colListData << append( dt << get column names ),  

 

// At startup, sselect the columns in the selection box for

// the columns that are selected in the data table

For( II = 1, II <= N Items( All Columns list ), II++,

   If( Column( ii ) << get selected == 1,

   colListData << set selected( II ));

);

Jim
dlee0416

Community Trekker

Joined:

Jun 11, 2014

Thanks txnelson​ and Ian@JMP​ for your help.  I have enough to finish the problem now.