3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.3.1
11 * Copyright(c) 2006-2010 Sencha Inc.
12 * licensing@sencha.com
13 * http://www.sencha.com/license
15 <div id="cls-Ext.ux.tree.TreeGridNodeUI"></div>/**
16 * @class Ext.ux.tree.TreeGridNodeUI
17 * @extends Ext.tree.TreeNodeUI
19 Ext.ux.tree.TreeGridNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
20 isTreeGridNodeUI: true,
22 renderElements : function(n, a, targetNode, bulkRender){
23 var t = n.getOwnerTree(),
28 this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
31 '<tbody class="x-tree-node">',
32 '<tr ext:tree-node-id="', n.id ,'" class="x-tree-node-el x-tree-node-leaf ', a.cls, '">',
33 '<td class="x-treegrid-col">',
34 '<span class="x-tree-node-indent">', this.indentMarkup, "</span>",
35 '<img src="', this.emptyIcon, '" class="x-tree-ec-icon x-tree-elbow" />',
36 '<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon', (a.icon ? " x-tree-node-inline-icon" : ""), (a.iconCls ? " "+a.iconCls : ""), '" unselectable="on" />',
37 '<a hidefocus="on" class="x-tree-node-anchor" href="', a.href ? a.href : '#', '" tabIndex="1" ',
38 a.hrefTarget ? ' target="'+a.hrefTarget+'"' : '', '>',
39 '<span unselectable="on">', (c.tpl ? c.tpl.apply(a) : a[c.dataIndex] || c.text), '</span></a>',
43 for(i = 1, len = cols.length; i < len; i++){
46 '<td class="x-treegrid-col ', (c.cls ? c.cls : ''), '">',
47 '<div unselectable="on" class="x-treegrid-text"', (c.align ? ' style="text-align: ' + c.align + ';"' : ''), '>',
48 (c.tpl ? c.tpl.apply(a) : a[c.dataIndex]),
55 '</tr><tr class="x-tree-node-ct"><td colspan="', cols.length, '">',
56 '<table class="x-treegrid-node-ct-table" cellpadding="0" cellspacing="0" style="table-layout: fixed; display: none; width: ', t.innerCt.getWidth() ,'px;"><colgroup>'
58 for(i = 0, len = cols.length; i<len; i++) {
59 buf.push('<col style="width: ', (cols[i].hidden ? 0 : cols[i].width) ,'px;" />');
61 buf.push('</colgroup></table></td></tr></tbody>');
63 if(bulkRender !== true && n.nextSibling && n.nextSibling.ui.getEl()){
64 this.wrap = Ext.DomHelper.insertHtml("beforeBegin", n.nextSibling.ui.getEl(), buf.join(''));
66 this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf.join(''));
69 this.elNode = this.wrap.childNodes[0];
70 this.ctNode = this.wrap.childNodes[1].firstChild.firstChild;
71 var cs = this.elNode.firstChild.childNodes;
72 this.indentNode = cs[0];
74 this.iconNode = cs[2];
76 this.textNode = cs[3].firstChild;
80 animExpand : function(cb){
81 this.ctNode.style.display = "";
82 Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this, cb);
86 Ext.ux.tree.TreeGridRootNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
87 isTreeGridNodeUI: true,
92 this.wrap = this.ctNode = this.node.ownerTree.innerCt.dom;
93 this.node.expanded = true;
97 // weird table-layout: fixed issue in webkit
99 ct.style.tableLayout = null;
101 ct.style.tableLayout = 'fixed';
106 destroy : function(){
108 Ext.dd.Registry.unregister(this.elNode.id);
113 collapse : Ext.emptyFn,