上传长文本文档后,弹出窗口的宽度会发生变化。 有没有办法用树点节点文本的三个点修剪长文本?
以下是我创建树结构的HTML代码
<div class="col-md-12" style="height:100%;overflow:auto" ng-if="IsTree">
<oe-jstree source="AssemblyDocuments"
name="documenttree"
is-upload-file="true"
options="treeOptions"
tree-node-creator="createNode(item)"
on-item-selected="NodeSelected(item)"
on-item-created="NodeCreated(item, callback)"
on-item-renamed="NodeRenamed(item, callback)"
on-item-removed="NodeRemoved(item, callback)"
on-item-archived="NodeArcive(item, callback)"
on-item-download="onItemDownload(item, callback)"
on-item-tagged="onItemTagged(item, callback)"
tag-list="TagMst"
is-read-only="isReadOnly"
id="documenttree"></oe-jstree>
</div>
如何使用工具提示剪切文本并显示三个点?
答案 0 :(得分:0)
$scope.createNode = function (nodedata) {
if (nodedata.Name != null)
nodedata.Name = nodedata.Name.trim();
var node = {
id: nodedata.Id,
text: nodedata.Name.substr(0, 60) + (nodedata.Name.length > 60 ? "..." : ""),
state: {
opened: true
},
type: nodedata.isFile == true ? File : Folder,
icon: nodedata.isFile == true ? (nodedata.Archive == true ? 'jstree-zip' : 'jstree-file') : 'jstree-folder',
children: GetChilders(nodedata),
FileTagDetails: nodedata.FileTagDetails,
model: nodedata,
a_attr: {
title: nodedata.Name
}
};
return node;
};
使用text: nodedata.Name.substr(0, 60) + (nodedata.Name.length > 60 ? "..." : ""),
可以获得3个点