でこの変数にアクセスしている間、この変数はonContext機能でアクセス可能ですが、私は、グリッドのストアオブジェクトにフェッチされたAjaxのJSONの結果を割り当てます。 {店舗:「一部-JSON」} グリッドgride等を目的とする例のようエラーdojojs
define([
"dojo/_base/declare",
"dojo/when",
"aps/_View",
"aps/xhr"
], function(
declare,
when,
_View,
xhr
) {
var page, grid, self, contextId,myResult,samp;
return declare(_View, {
init: function() {
self = this;
return ["aps/Grid", {
id: "srv_grid",
selectionMode: "multiple",
columns: [{
field: "id",
name: "Id"
}]
},
];
}, // End of Init
onContext: function(context) {
this.grid = this.byId("srv_grid"); //working
xhr.get("/aps/2/resources/" + aps.context.vars.device.aps.id + "/getresource").
then(function(data){
myResult=data;
this.grid.params.store=data; //got error here this.grid is undefined
this.grid.store=data; //got error here this.grid is undefined
}
),
this.grid.refresh();
},
}); // End of Declare
}); // End of Define
init
最初呼び出す第一の方法では、onContext
メソッド呼び出しが..この言葉は、その機能で利用可能でthis
変数にthis.gridプロパティがアクセスできないthis.gridプロパティがxhr.get()
にあります。これのプロパティはxhr.get()
に変更されています。私はこの内部のすべてのプロパティにアクセスしたいxhr.get()
機能。私はthis.grid.store
とthis.grid.params.store
財産
このエラーが発生しました。「k.queryは関数ではありません」 – vaibhav