3 * Copyright(c) 2006-2010 Ext JS, Inc.
5 * http://www.extjs.com/license
8 * @class Ext.ux.tree.TreeGridNodeUI
9 * @extends Ext.tree.TreeNodeUI
11 Ext.ux.tree.TreeGridNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
12 isTreeGridNodeUI: true,
14 renderElements : function(n, a, targetNode, bulkRender){
15 var t = n.getOwnerTree(),
20 this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
23 '<tbody class="x-tree-node">',
24 '<tr ext:tree-node-id="', n.id ,'" class="x-tree-node-el x-tree-node-leaf ', a.cls, '">',
25 '<td class="x-treegrid-col">',
26 '<span class="x-tree-node-indent">', this.indentMarkup, "</span>",
27 '<img src="', this.emptyIcon, '" class="x-tree-ec-icon x-tree-elbow">',
28 '<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon', (a.icon ? " x-tree-node-inline-icon" : ""), (a.iconCls ? " "+a.iconCls : ""), '" unselectable="on">',
29 '<a hidefocus="on" class="x-tree-node-anchor" href="', a.href ? a.href : '#', '" tabIndex="1" ',
30 a.hrefTarget ? ' target="'+a.hrefTarget+'"' : '', '>',
31 '<span unselectable="on">', (c.tpl ? c.tpl.apply(a) : a[c.dataIndex] || c.text), '</span></a>',
35 for(i = 1, len = cols.length; i < len; i++){
38 '<td class="x-treegrid-col ', (c.cls ? c.cls : ''), '">',
39 '<div unselectable="on" class="x-treegrid-text"', (c.align ? ' style="text-align: ' + c.align + ';"' : ''), '>',
40 (c.tpl ? c.tpl.apply(a) : a[c.dataIndex]),
47 '</tr><tr class="x-tree-node-ct"><td colspan="', cols.length, '">',
48 '<table class="x-treegrid-node-ct-table" cellpadding="0" cellspacing="0" style="table-layout: fixed; display: none; width: ', t.innerCt.getWidth() ,'px;"><colgroup>'
50 for(i = 0, len = cols.length; i<len; i++) {
51 buf.push('<col style="width: ', (cols[i].hidden ? 0 : cols[i].width) ,'px;" />');
53 buf.push('</colgroup></table></td></tr></tbody>');
55 if(bulkRender !== true && n.nextSibling && n.nextSibling.ui.getEl()){
56 this.wrap = Ext.DomHelper.insertHtml("beforeBegin", n.nextSibling.ui.getEl(), buf.join(''));
58 this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf.join(''));
61 this.elNode = this.wrap.childNodes[0];
62 this.ctNode = this.wrap.childNodes[1].firstChild.firstChild;
63 var cs = this.elNode.firstChild.childNodes;
64 this.indentNode = cs[0];
66 this.iconNode = cs[2];
68 this.textNode = cs[3].firstChild;
72 animExpand : function(cb){
73 this.ctNode.style.display = "";
74 Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this, cb);
78 Ext.ux.tree.TreeGridRootNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
79 isTreeGridNodeUI: true,
84 this.wrap = this.ctNode = this.node.ownerTree.innerCt.dom;
85 this.node.expanded = true;
89 // weird table-layout: fixed issue in webkit
91 ct.style.tableLayout = null;
93 ct.style.tableLayout = 'fixed';
100 Ext.dd.Registry.unregister(this.elNode.id);
105 collapse : Ext.emptyFn,