为什么我数据加载后会变成这鸟样!
ztree吧
全部回复
仅看楼主
level 1
茕茕1245 楼主
这个怎么破,555!
2012年04月11日 08点04分 1
level 11
典型的 样式问题,请检查 css 和image
强烈推荐直接用 chrome 的调试工具!!! so easy
2012年04月11日 08点04分 2
level 1
茕茕1245 楼主
唆噶!
2012年04月11日 08点04分 3
level 1
茕茕1245 楼主
<button id="treeDemo_2_switch" class="level1 switch center_docu" treenode_switch="" title="" disabled="" hidefocus="true" type="button"></button>
在节点前面自动添加了button,怎么去除啊,或者改图标?
2012年04月11日 09点04分 4
level 1
茕茕1245 楼主

if (openFlag) {
var url = view.makeNodeUrl(setting, node),
fontcss = view.makeNodeFontCss(setting, node),
fontStyle = [];
for (var f in fontcss) {
fontStyle.push(f, ":", fontcss[f], ";");
}
html.push("<li id='", node.tId, "' class='level", node.level,"' treenode>",
"<button type='button' hidefocus='true'",(node.isParent?"":"disabled")," id='", node.tId, consts.id.SWITCH,
"' title='' class='", view.makeNodeLineClass(setting, node), "' treeNode", consts.id.SWITCH,"></button>");
data.getBeforeA(setting, node, html);
html.push("<a id='", node.tId, consts.id.A, "' class='level", node.level,"' treeNode", consts.id.A," onclick=\"", (node.click || ''),
"\" ", ((url != null && url.length > 0) ? "href='" + url + "'" : ""), " target='",view.makeNodeTarget(node),"' style='", fontStyle.join(''),
"'");
if (tools.apply(setting.view.showTitle, [setting.treeId, node], setting.view.showTitle) && node[titleKey]) {html.push("title='", node[titleKey].replace(/'/g,"'").replace(/</g,'<').replace(/>/g,'>'),"'");}
html.push(">");
data.getInnerBeforeA(setting, node, html);
var name = setting.view.nameIsHTML ? node[nameKey] : node[nameKey].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
html.push("<button type='button' hidefocus='true' id='", node.tId, consts.id.ICON,
"' title='' treeNode", consts.id.ICON," class='", view.makeNodeIcoClass(setting, node), "' style='", view.makeNodeIcoStyle(setting, node), "'></button><span id='", node.tId, consts.id.SPAN,
"'>",name,"</span>");
data.getInnerAfterA(setting, node, html);
html.push("</a>");
data.getAfterA(setting, node, html);
if (node.isParent && node.open) {
view.makeUlHtml(setting, node, html, childHtml.join(''));
}
html.push("</li>");
data.addCreatedNode(setting, node);
}
}
return html;
好像生成代码是这一段,button是必须的吗?
2012年04月11日 09点04分 5
level 6
没调用样式
2012年04月11日 13点04分 6
level 11
1、 这个button 就是那些连线的图标呀,你有没有正常加载 zTree 的css ???
让你用 chrome 调试不是单纯看你的代码,你要配合看看 demo 中正常的样式进行对比
2、目前正在做 v3.2 ,到时候会把 button 都换成 span 的了。只要你不使用自定义的图标,应该不会有什么影响
2012年04月11日 13点04分 7
level 1
茕茕1245 楼主
哦,菜鸟表示压力大
2012年04月11日 15点04分 8
level 11
不要压力大,别着急,静下心来。。。。知识都需要有一个积累的过程
2012年04月12日 00点04分 9
level 3
同样的问题我遇见过,是css路径问题。css文件未能正确加载。。。
2012年04月15日 06点04分 10
1