[英]dijit.Tree Folders appear with a icon PLUS even if no children are present
我正在使用以下代码来渲染dijit.Tree,如您从图片中看到的那样,我遇到了这些问题:
您能告诉我我在做什么错吗?
this._tree = new Tree({
model: this._model,
showRoot: false,
autoExpand: false,
persist: false,
getLabel: function (item) {
return item.name;
}
});
this._tree.placeAt(this.node);
this._tree.startup();
这是由于模型的mayHaveChildren
方法mayHaveChildren
。
您必须重写此方法才能使其“更智能” ...请参阅: https : //dojotoolkit.org/documentation/tutorials/1.6/store_driven_tree/
mayHaveChildren(object)-指示对象是否有子对象(在实际加载子对象之前)
您可以参考以下示例:
Dijit树过滤和搜索不适用于ObjectStoreModel
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.