私のポストはtumbleweed ... awesomeを得ました! :) 私は回避策を考え出しました。ここにあります。
var that = this;
this.trgTree =
new dijit.Tree({
model: this.trgTreeModel,
dndController: "dijit.tree.dndSource",
checkAcceptance: this.treeCheckAcceptance,
checkItemAcceptance: this.trgTreeCheckItemAcceptance,
getIconClass: app.getIcon,
onDndDrop: function(source, nodes, copy) {
that.handleDrop(that, dijit.getEnclosingWidget(
nodes[0]).item, this.current.item);
that.srcStore.save();
that.trgStore.save();
}
}, "trgTree");
handleDrop: function(inPage, inSrcItem, inTrgItem) {
console.info("*** start addItem: srcItem: " + inSrcItem.name[0]);
var srcType = inSrcItem.type[0];
var kids = inSrcItem.items;
if (inTrgItem.type != "fooType") {
// do something unique for fooType node targets
}
// add the item to the tree
inPage.addItem(inPage, inSrcItem, inTrgItem);
}
addItem: function(inPage, inSrcItem, inTrgItem) {
var srcType = inSrcItem.type[0];
var trgType = inTrgItem.type[0];
var theName = inSrcItem.name[0];
if (srcType == "fooType") {
srcType = inSrcItem.txType[0];
}
var newItem = {
id: inSrcItem.id[0],
name: theName,
type: srcType,
items: []
};
newItem = inPage.trgStore.newItem(newItem);
inPage.trgTreeModel.pasteItem(newItem, null, inTrgItem, false, 0);
var kids = inSrcItem.items;
if (kids !== undefined) {
// call recursively to add child items
for (var i in kids) {
inPage.addItem(inPage, kids[i], newItem);
// TODO: expand the node after it is added
}
}
},
このコードのすべてが(これはWaveMakerのプロジェクトであるのでクラスがwm.Pageである)、これは、そのクラスである単一のクラスの内側にあるのコンテキストです。 これに関する詳細やドキュメントがありません申し訳ありませんが、それは良いスタートコードです。あなたが私の回避策について特定の質問をしている場合は、尋ねるだけで、私は答えをタイムリーにしようとします。
WaveMakerフォーラム[こちら](http://dev.wavemaker.com/forums/?q=node/6219)でこれを行う方法については、かなり良い記事があります。 –