Foros: 公開ディスカッション (Thread #30022)

grid内でのgetvalue時にエラー (2011-08-04 11:39 by naokiiwano #58906)

loadしてるjs内にてグリッド内のイベントを処理してますが、grid.getValue()時に、「オブジェクトでサポートされていないプロパティまたはメソッドです」の表示がでます。
原因がわかりません。
処理は、sample-phpのフルーツショップの受注明細の「選択行を削除」と同じことをしようとしており、ソースもコピーして使ってます。Grid名とfunction名が違う程度です。

以下、その個所を添付します。
with(event.layout.scope){
var data = postListGrid.getValue() <-- これがエラーになる。
var newRows = [];
for (var i = 0; i < data.length; i++) {
if (!data[i].sel) {
newRows.push(data[i]);
}
postListGrid.setValue(newRows);
}
}

なお、同環境内に、フルーツショップのソースを持ってきて処理した場合はエラーになりません。

以上、よろしくお願いいたします。

Responder al #58906×

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.) Entrar

RE: grid内でのgetvalue時にエラー (2011-08-04 11:46 by naokiiwano #58907)

参考までに、同一画面上でサンプルのcalculate(event)のNumber(leftOperandText.getValue()を
処理してみたところエラーなく実施できます。
Responder al #58906

Responder al #58907×

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.) Entrar

RE: grid内でのgetvalue時にエラー (2011-08-04 12:53 by kominen #58910)

事象の切り分けのため、変数 postListGrid を宣言している箇所、値を格納している箇所のソースをご提示ください。
Responder al #58907

Responder al #58910×

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.) Entrar

RE: grid内でのgetvalue時にエラー (2011-08-04 12:54 by kominen #58911)

レイアウト定義XMLにて、postListGrid を定義されている行についても共有いただけますでしょうか?
Responder al #58907

Responder al #58911×

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.) Entrar

RE: grid内でのgetvalue時にエラー (2011-08-04 18:51 by naokiiwano #58917)

①layout.xml, ②layout_e_xml, ③postmaster.js内functionを添付します。

①layout.xmlになります。
<?xml version="1.0" encoding="UTF-8"?>
<layoutDef>
<layout name="postmaster">
<frame name="postmaserFrame" top="16" left="19" width="829" height="625" title="郵便マスタ">
<frame name="postlistFrame" top="180" left="11" width="650" height="317" title="一覧表示">
<button name="searchListButton" top="19" left="18" width="88" tabIndex="-1" title="一覧" adaptToText="false"/>
<button name="removePostDetailButton" top="19" left="128" width="88" tabIndex="7" title="選択行を削除" adaptToText="false"/>
<grid name="postListGrid" top="46" left="17" height="247" tabIndex="-1" lineHeight="25" switchable="false" multiSelect="true">
<gridHeader width="100" title="郵便番号" type="string"/>
<gridHeader width="450" title="住所" type="string"/>
</grid>
</frame>
</frame>
</layout>
</layoutDef>

②layout_e_xmlになります。
<?xml version="1.0" encoding="UTF-8"?>
<eventDef>
<component id="searchListButton">
<event id="onclick" remoteUrl="./list_post.php" async="false">
<param rootNode="request"/>
<result rootNode="response">
<target out="postListGrid" in="posts" inkey="post">
<bind node="postNo" tokey="0"/>
<bind node="Address" tokey="1"/>
</target>
</result>
</event>
</component>
<component id="removePostDetailButton">
<event id="onclick" finish="removePostDetail" type="local"/>
</component>
</eventDef>

③function removePostDetailになります。
function removePostDetail(event) {
with(event.layout.scope) {
var data = postListGrid.getValue();
var newRows = [];

for (var i = 0; i < data.length; i++) {
if (!data[i].sel) {
newRows.push(data[i]);
}
}
postListGrid.setValue(newRows);
}

}
Responder al #58906

Responder al #58917×

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.) Entrar

RE: grid内でのgetvalue時にエラー (2011-08-08 11:58 by kominen #59029)

ソース、設定ファイルの共有ありがとうございます。事象の確認をしたところ、おそらく下記の差異が原因かと思われますのでご確認ください。

・サンプルの fruitshop では、properties.json の設定にて、core 配下の "variable.widget" が "wrapped" に設定されている。

こちらの設定では、layout.scope 配下に配置するオブジェクトの形式を指定してます。

"wrapped" の場合はマスカットが提供する部品のオブジェクトを格納し、"unwrapped" の場合は、マスカットが内包している rialto などのプラグイン本体のオブジェクトが格納されます。

getValue は、マスカット側の Tree が提供するAPIである一方、この設定が未設定(デフォルトでは "unwrapped")であるため、エラーが発生していると思われます。


properties.json の core 配下に "variable.widget": "wrapped" の設定をしてみてください。
Responder al #58917

Responder al #59029×

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.) Entrar

RE: grid内でのgetvalue時にエラー (2011-08-08 12:32 by naokiiwano #59030)

お世話になります。
メッセージありがとうございます。

さっそく設定しましたところ、gridに関するほかの操作エラーも含めすべて解消されました。
勉強不足で申し訳ございません。

ありがとうございました。
今後ともよろしくお願いいたします。
Responder al #58906

Responder al #59030×

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.) Entrar