選択したデータテーブルの列名を動的にリストする方法は?こんにちは、
Tables-Join のようなウィンドウを作成しようとしています。2 番目のアウトライン ボックスは、選択したデータ テーブルの列名を左上隅のリスト ボックスに動的にリストできます。
ありがとうございます。
スクリプティングウィンドウズRe: 選択したデータ テーブルの列名を動的に一覧表示する方法は?Names Default To Here(1);
//Open two data tables
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Open("$SAMPLE_DATA/Consumer Preferences.jmp");
//Make sure the one not used in filter col selector is current data table
Current Data Table(dt2);
wait(0);
//Create filter col selector with non current data table
New Window("Filter Col Selector Example",
fontobj = lb = Filter Col Selector(Data table(dt)) //replace "big class" with dt work.
);データテーブル(「ビッグクラス」)をデータテーブル(dt)に置き換えると、機能します。
Re: 選択したデータ テーブルの列名を動的に一覧表示する方法は?これを簡単に見てみると、Filter Col Selector を使用する際に注意しなければならないことが 2 つあります。
- Filter Col Selector は常に Current Data table() を使用しているようで、使用するデータテーブルを直接参照することはできません。 Scripting Index に基づいて、Datatable(name) を引数として受け入れる必要があるため、おそらくバグです (少なくとも JMP16.1 では)。
- Filter Col Box の赤い三角形は、削除する必要がある別の DisplayBox です。
参照を回避するには、ユーザーの選択に基づいて現在のデータ テーブル() を変更し、赤い三角形も削除してみてください。フィルター コル ボックスを V リスト ボックスに巻き付けて削除します。
Names Default To Here(1);
//get a list of window names
windows = Get Data Table List();
/*remove ones that are not data tables--need to start at back of list, because its length will change as we delete items
For( i = N Items( windows ), i > 0, i--,
If( (Window( windows[i] ) << Window Class Name) != "DataTable",
Remove From( windows, i )
)
);
*/
//make a dialog window
nw = New Window("Sample",
vlb1 = V List Box(
lb1 = List Box(
windows, //populate the listbox with data table names
//here is the script that runs each time someone clicks in the top box
//delete the current column list box, if it exists
Try(vlb2 << delete);
//append a new v list box which includes filter col selector
Current Data Table(Data Table((lb1 << get selected)[1]));
vlb1 << append(vlb2 = V List Box(Filter Col Selector()));
)
)
);また、フィルター コル セレクターで問題を再現する簡単なスクリプトを次に示します。
Names Default To Here(1);
//Open two data tables
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Open("$SAMPLE_DATA/Consumer Preferences.jmp");
//Make sure the one not used in filter col selector is current data table
Current Data Table(dt2);
wait(0);
//Create filter col selector with non current data table
New Window("Filter Col Selector Example",
fontobj = lb = Filter Col Selector(Data table("Big Class"))
);Re: 選択したデータ テーブルの列名を動的に一覧表示する方法は?お返事ありがとうございます。 「col list box」を「filter col selector」に置き換えましたが、期待どおりに機能せず、テーブルを選択するたびに赤い三角形が残り、列リストがそれに応じて更新されません。
「フィルター列セレクター」を使用してどのように機能しますか?
Names Default To Here( 1 );
//get a list of window names
windows = Get Data Table List();
/*remove ones that are not data tables--need to start at back of list, because its length will change as we delete items
For( i = N Items( windows ), i > 0, i--,
If( (Window( windows[i] ) << Window Class Name) != "DataTable",
Remove From( windows, i )
)
);
*/
//make a dialog window
nw = New Window( "Sample",
vlb1 = V List Box(
lb1 = List Box(
windows, //populate the listbox with data table names
//here is the script that runs each time someone clicks in the top box
//delete the current column list box, if it exists
Try( lb2 << delete );
//append a new col list box, with all columns of the data table selected in the listbox
vlb1 << append( lb2 = Filter Col Selector( Data Table( (lb1 << get selected)[1] ), all ) );
)
)
);

Re: 選択したデータ テーブルの列名を動的に一覧表示する方法は?こんにちは、
これを行うには、次のようなコードを使用できます。 いくつかのデータ テーブルを開いているときに、このコードを実行してみてください。
乾杯、
ブレイディ
Names Default To Here( 1 );
//get a list of window names
windows = Window() << get window title;
//remove ones that are not data tables--need to start at back of list, because its length will change as we delete items
For( i = N Items( windows ), i > 0, i--,
If( (Window( windows[i] ) << Window Class Name) != "DataTable",
Remove From( windows, i )
)
);
//make a dialog window
nw = New Window( "Sample",
vlb1 = V List Box(
lb1 = List Box(
windows, //populate the listbox with data table names
//here is the script that runs each time someone clicks in the top box
//delete the current column list box, if it exists
Try( lb2 << delete );
//append a new col list box, with all columns of the data table selected in the listbox
vlb1 << append( lb2 = Col List Box( Data Table( (lb1 << get selected)[1] ), all ) );
)
)
);

