The style allows the background div to be added with scroll bars.
or, use the ellipsis method : Use adddiydom http://blog.csdn.net/zhengbo0/article/details/17759543
var setting = {
View: {
Adddiydom:adddiydom
}
};
function Adddiydom (Treeid, TreeNode) {
var spacewidth = 5;
var switchobj = $ ("#" + Treenode.tid + "_switch"),
Icoobj = $ ("#" + Treenode.tid + "_ico");
Switchobj.remove ();
Icoobj.parent (). before (Switchobj);
var spantxt = $ ("#" + Treenode.tid + "_span"). html ();
if (Spantxt.length > 17) {
Spantxt = spantxt.substring (0, 17) + "...";
$ ("#" + Treenode.tid + "_span"). HTML (spantxt);
}
}
When there is a checkbox,
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, 17) + "...";
$ ("#" + Treenode.tid + "_span"). HTML (spantxt);
}
}
Ztree Tree Plugin tree node name too long solution