我有一个dojo dijit.Tree,我希望能够在标签中加入一些html.为此,我创建了一个名为getCustomLabel的函数,并将其分配给树的getLabel属性:
tree = new dijit.Tree({
model: aMOdel,
showRoot: false,
getLabel: getCustomLabel
});
function getCustomLabel(item) {
return '<b>'+item.name+'</b>'
}
Run Code Online (Sandbox Code Playgroud)
这将返回一个带有html转义的树,以便它显示在树中.有谁知道在树形小部件中获取未转义的html的方法?