|
@@ -18,7 +18,10 @@
|
|
|
data: 'name',
|
|
|
static: false,
|
|
|
width: '100%',
|
|
|
- event: {}
|
|
|
+ event: {
|
|
|
+ getText: null,
|
|
|
+ getIcon: null
|
|
|
+ }
|
|
|
}
|
|
|
],
|
|
|
dataTemp: {
|
|
@@ -423,67 +426,31 @@
|
|
|
obj.append(tbody);
|
|
|
return tbody;
|
|
|
},
|
|
|
- /*_makeTreeExpandBtn: function (obj, node){
|
|
|
- var span = $('<a href="#" class="tree-open" title="收起"><i class="fa fa-minus-square-o mr-1"></i></a>'),
|
|
|
- btn = $('i', span);
|
|
|
- obj.append(span);
|
|
|
- node.expandBtn = span;
|
|
|
- btn.bind('click', {node: node}, function(e){
|
|
|
- e.data.node.expand(!e.data.proj.expand());
|
|
|
- });
|
|
|
- if (node.children.length === 0) {
|
|
|
- span.hide();
|
|
|
- } else {
|
|
|
- span.show();
|
|
|
- }
|
|
|
- return span;
|
|
|
- },*/
|
|
|
_makeTableRowCell: function (obj, node, columns, index) {
|
|
|
var html = [], td, i, url;
|
|
|
|
|
|
html.push('<td ');
|
|
|
if (index === node.setting.tree.btnColumn){
|
|
|
html.push('class=', 'in-', node.depth().toString(), '>');
|
|
|
- // to Do 此部分中Folder与Tender的区别应由外部控制
|
|
|
- if (node.children.length !== 0) {
|
|
|
- html.push('<a href="#" class="tree-open" title="收起"><i class="fa fa-minus-square-o mr-1"></i></a>');
|
|
|
- } else if (node.data.projType === 'Folder') {
|
|
|
- html.push('<a href="#" class="tree-open" title="收起"><i class="in-2"></i></a>');
|
|
|
- } else {
|
|
|
- if (node.parent === node.tree._root) {
|
|
|
- html.push('<span class="in-1 poj-icon">└</span>');
|
|
|
- } else {
|
|
|
- html.push('<span class="in-3 poj-icon">└</span>');
|
|
|
- }
|
|
|
- }
|
|
|
- if (node.data.projType === 'Folder') {
|
|
|
- html.push('<i class="tree-icon fa fa-folder-open-o"></i>');
|
|
|
+ if (node.children.length !== 0) {
|
|
|
+ html.push('<a href="#" class="tree-open" title="收起"><i class="fa fa-minus-square-o mr-1"></i></a>');
|
|
|
} else {
|
|
|
- html.push('<i class="tree-icon"></i>');
|
|
|
+ html.push('<a href="#" class="tree-open" title="收起"><i></i></a>');
|
|
|
}
|
|
|
} else {
|
|
|
html.push('>');
|
|
|
}
|
|
|
|
|
|
- if (!columns.static) {
|
|
|
- //html.push(' ', node.data[columns.data]);
|
|
|
- if (node.data.projType === 'Folder') {
|
|
|
- html.push(' ');
|
|
|
- }
|
|
|
- html.push('<a ');
|
|
|
- if (columns.event.getUrl) {
|
|
|
- url = columns.event.getUrl(node);
|
|
|
- if (url) {
|
|
|
- html.push('href="', url, '"')
|
|
|
- }
|
|
|
- }
|
|
|
- html.push('>');
|
|
|
- if (columns.event.textFormat) {
|
|
|
- html.push(columns.event.textFormat(node.data[columns.data]));
|
|
|
+ if (columns.event.getIcon) {
|
|
|
+ columns.event.getIcon(html, node);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (columns.name !== '') {
|
|
|
+ if (columns.event.getText) {
|
|
|
+ columns.event.getText(html, node, node.data[columns.data]);
|
|
|
} else {
|
|
|
- html.push(node.data[columns.data]);
|
|
|
+ html.push(node.data[columns.name]);
|
|
|
}
|
|
|
- html.push('</a>');
|
|
|
}
|
|
|
html.push('</td>');
|
|
|
|