本文实例分享了jquery ztree实现树的搜索功能,供大家参考,具体内容如下
var userZTree;
var userSetting={
check: {
enable: true,
chkStyle: "radio",
chkboxType : {"Y" : "" , "N" : ""},
radioType: "all"
},
data: {
simpleData: {
enable: true,
idKey : "id",
pIdKey : "pid"
}
},
callback:{
onClick : clickCheck
},
view :{
showIcon: false,
fontCss: getFontCss
}
};
这里要加一个属性:view:{fontCss:getFontCss}
这里的getFontCss为自己写的一个方法:
function getFontCss(treeId, treeNode) {
return (!!treeNode.highlight) ? {color:"#A60000", "font-weight":"bold"} : {color:"#333", "font