LoginSignup
0
0

More than 5 years have passed since last update.

IM-FormaDesigner / IM-BIS セレクトボックス Option値をAPIで設定する

Last updated at Posted at 2019-03-11

IM-FormaDesigner / IM-BIS セレクトボックス Option値をAPIで設定する

前提

  • intra-mart Accel Platform
  • IM-FormaDesiner / IM-BIS

やりかた

IM-BIS クライアントサイドスクリプトAPI
上記のAPI解説には書いてないが、setItemDataのargsにmasterプロパティが設定されていればその値となる

masterプロパティの内容は下記の通りに設定する

master.%フィールド識別ID%.[i].value_%フィールド識別ID%
master.%フィールド識別ID%.[i].key_%フィールド識別ID%

分かりにくいと思うのでサンプルを提示する
これをクライアントサイドスクリプトで使う

sample.js
// フィールド識別IDを指定
var dep2_id = "dep2_selectbox";
var dep2_args = {};
// Option項目設定
dep2_args.master = {};
dep2_args.master[dep2_id] = [];
// 空行設定
var emprow = {};
emprow["value_" + dep2_id] = "";
emprow["key_" + dep2_id] = "";
dep2_args.master[dep2_id].push(emprow);

// 1行目設定
var row1 = {};
row1["value_" + dep2_id] = "1";
row1["key_" + dep2_id] = "1行目";
dep2_args.master[dep2_id].push(row1);

// 2行目設定
var row2 = {};
row2["value_" + dep2_id] = "2";
row2["key_" + dep2_id] = "2行目";
dep2_args.master[dep2_id].push(row2);

// 選択値設定
dep2_args.data = {};
dep2_args.data[dep2_id] = "";
formaItems.product_80_selectbox.setItemData[dep2_id](dep2_args);

おそらくリストボックス、チェックボックス、ラジオボタンでも使える

注意事項

公式のAPI資料には載っていない方法ですので使用は自己責任でお願いします

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0