Foren: 公開ディスカッション (Thread #28284)

gridの選択した値について (2010-12-27 14:45 by Anonym #55004)

いつも参考にさせていただいてます。

ポップアップ上のgridにセットした値を選択し、その選択した値を親画面の指定したテキストに表示させるという
処理を行いたいと思っていますが、どのようにすればいいのかわかりません。

お手数ですが、解決策を教えてください。

よろしくお願いします。

Reply to #55004×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: gridの選択した値について (2011-01-04 15:06 by uchidahd #55102)

選択セルのデータを直接取得することはできない為、
gridの持っているデータと、選択位置を別々で取得し、
必要なデータを抜き出す必要があります。

また、選択した値がgridの単一セルなのか、行なのかによって取得の方法が違います。
(cellActive属性がtrueかfalseか)

行のデータの場合は、以下のように取得できます。

var txt = event.layout.getWidget("txtNew");
var grd = event.layout.getWidget("grdNew");
var dataArray = grd.getValue();
var slIdx = grd.getSelectedIndex();
if (!isNaN(slIdx) && slIdx >= 0) {
txt.setValue(dataArray[slIdx].join(" "));
}


単一セル(cellActive = true)の場合は、
以下のように選択列も取得する必要があります。

var txt = event.layout.getWidget("txtNew");
var grd = event.layout.getWidget("grdNew");
var dataArray = grd.getValue();
var slIdx = grd.getSelectedIndex();
var clIdx = grd.widget.indCellClic; // 選択列のインデックス (String型)
if (!isNaN(slIdx) && slIdx >= 0) {
txt.setValue(dataArray[slIdx][lIdx]);
}
Reply to #55004

Reply to #55102×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: gridの選択した値について (2011-01-05 13:01 by Anonym #55122)

ありがとうございます。

早速チャレンジしてみます。

本当にありがとうございました。
Reply to #55004

Reply to #55122×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden