[英]dijit.Tree Folders appear with a icon PLUS even if no children are present
I am using the following code to render a dijit.Tree, as you can see from the picture I have these issues: 我正在使用以下代码来渲染dijit.Tree,如您从图片中看到的那样,我遇到了这些问题:
Could you please tell me what am I doing wrong here? 您能告诉我我在做什么错吗?
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();
This is due to the method mayHaveChildren
of the model. 这是由于模型的
mayHaveChildren
方法mayHaveChildren
。
You have to override this method to make it "smarter"... See : https://dojotoolkit.org/documentation/tutorials/1.6/store_driven_tree/ 您必须重写此方法才能使其“更智能” ...请参阅: https : //dojotoolkit.org/documentation/tutorials/1.6/store_driven_tree/
mayHaveChildren(object) - Indicates whether or not an object may have children (prior to actually loading the children)
mayHaveChildren(object)-指示对象是否有子对象(在实际加载子对象之前)
You can refer to this for an example: 您可以参考以下示例:
Dijit Tree filtering and search not working on ObjectStoreModel Dijit树过滤和搜索不适用于ObjectStoreModel
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.