zTree自定义节点name显示样式
//setting中配置属性 view: { showLine:false, dblClickExpand: true, showIcon: false, addDiyDom: addDiyDom //自定义 } //添加自定义样式函数 function addDiyDom(treeId, treeNode) { var spaceWidth = 5; var switchObj = $("#" + treeNode.tId + "_switch"), checkObj = $("#" + treeNode.tId + "_check"), icoObj = $("#" + treeNode.tId + "_ico"); switchObj.remove(); checkObj.remove(); icoObj.parent().before(switchObj); icoObj.parent().before(checkObj); var spantxt = $("#" + treeNode.tId + "_span").html(); if (spantxt.length > 17) { spantxt = spantxt.substring(0, 15) + "..."; //最多显示15个字 $("#" + treeNode.tId + "_span").html(spantxt); } }
收录详解地址:
http://www.360doc.com/content/19/0523/11/19913882_837657547.shtml