<!DOCTYPE html>
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<title>The source code</title>
|
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
|
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
|
<style type="text/css">
|
.highlight { display: block; background-color: #ddd; }
|
</style>
|
<script type="text/javascript">
|
function highlight() {
|
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
|
}
|
</script>
|
</head>
|
<body onload="prettyPrint(); highlight();">
|
<pre class="prettyprint lang-js"><span id='Ext-tree-Column'>/**
|
</span> * Provides indentation and folder structure markup for a Tree taking into account
|
* depth and position within the tree hierarchy.
|
*
|
* @private
|
*/
|
Ext.define('Ext.tree.Column', {
|
extend: 'Ext.grid.column.Column',
|
alias: 'widget.treecolumn',
|
|
<span id='Ext-tree-Column-cfg-tdCls'> tdCls: Ext.baseCSSPrefix + 'grid-cell-treecolumn',
|
</span>
|
<span id='Ext-tree-Column-property-autoLock'> autoLock: true,
|
</span><span id='Ext-tree-Column-cfg-lockable'> lockable: false,
|
</span><span id='Ext-tree-Column-property-draggable'> draggable: false,
|
</span><span id='Ext-tree-Column-cfg-hideable'> hideable: false,
|
</span>
|
<span id='Ext-tree-Column-property-iconCls'> iconCls: Ext.baseCSSPrefix + 'tree-icon',
|
</span><span id='Ext-tree-Column-property-checkboxCls'> checkboxCls: Ext.baseCSSPrefix + 'tree-checkbox',
|
</span><span id='Ext-tree-Column-property-elbowCls'> elbowCls: Ext.baseCSSPrefix + 'tree-elbow',
|
</span><span id='Ext-tree-Column-property-expanderCls'> expanderCls: Ext.baseCSSPrefix + 'tree-expander',
|
</span><span id='Ext-tree-Column-property-textCls'> textCls: Ext.baseCSSPrefix + 'tree-node-text',
|
</span><span id='Ext-tree-Column-property-innerCls'> innerCls: Ext.baseCSSPrefix + 'grid-cell-inner-treecolumn',
|
</span><span id='Ext-tree-Column-property-isTreeColumn'> isTreeColumn: true,
|
</span>
|
<span id='Ext-tree-Column-property-cellTpl'> cellTpl: [
|
</span> '<tpl for="lines">',
|
'<img src="{parent.blankUrl}" class="{parent.childCls} {parent.elbowCls}-img ',
|
'{parent.elbowCls}-<tpl if=".">line<tpl else>empty</tpl>"/>',
|
'</tpl>',
|
'<img src="{blankUrl}" class="{childCls} {elbowCls}-img {elbowCls}',
|
'<tpl if="isLast">-end</tpl><tpl if="expandable">-plus {expanderCls}</tpl>"/>',
|
'<tpl if="checked !== null">',
|
'<input type="button" role="checkbox" <tpl if="checked">aria-checked="true" </tpl>',
|
'class="{childCls} {checkboxCls}<tpl if="checked"> {checkboxCls}-checked</tpl>"/>',
|
'</tpl>',
|
'<img src="{blankUrl}" class="{childCls} {baseIconCls} ',
|
'{baseIconCls}-<tpl if="leaf">leaf<tpl else>parent</tpl> {iconCls}"',
|
'<tpl if="icon">style="background-image:url({icon})"</tpl>/>',
|
'<tpl if="href">',
|
'<a href="{href}" target="{hrefTarget}" class="{textCls} {childCls}">{value}</a>',
|
'<tpl else>',
|
'<span class="{textCls} {childCls}">{value}</span>',
|
'</tpl>'
|
],
|
|
<span id='Ext-tree-Column-method-initComponent'> initComponent: function() {
|
</span> var me = this;
|
|
me.origRenderer = me.renderer;
|
me.origScope = me.scope || window;
|
|
me.renderer = me.treeRenderer;
|
me.scope = me;
|
|
me.callParent();
|
},
|
|
<span id='Ext-tree-Column-method-treeRenderer'> treeRenderer: function(value, metaData, record, rowIdx, colIdx, store, view){
|
</span> var me = this,
|
cls = record.get('cls'),
|
renderer = me.origRenderer,
|
data = record.data,
|
parent = record.parentNode,
|
rootVisible = view.rootVisible,
|
lines = [],
|
parentData;
|
|
if (cls) {
|
metaData.tdCls += ' ' + cls;
|
}
|
|
while (parent && (rootVisible || parent.data.depth > 0)) {
|
parentData = parent.data;
|
lines[rootVisible ? parentData.depth : parentData.depth - 1] =
|
parentData.isLast ? 0 : 1;
|
parent = parent.parentNode;
|
}
|
|
return me.getTpl('cellTpl').apply({
|
record: record,
|
baseIconCls: me.iconCls,
|
iconCls: data.iconCls,
|
icon: data.icon,
|
checkboxCls: me.checkboxCls,
|
checked: data.checked,
|
elbowCls: me.elbowCls,
|
expanderCls: me.expanderCls,
|
textCls: me.textCls,
|
leaf: data.leaf,
|
expandable: record.isExpandable(),
|
isLast: data.isLast,
|
blankUrl: Ext.BLANK_IMAGE_URL,
|
href: data.href,
|
hrefTarget: data.hrefTarget,
|
lines: lines,
|
metaData: metaData,
|
// subclasses or overrides can implement a getChildCls() method, which can
|
// return an extra class to add to all of the cell's child elements (icon,
|
// expander, elbow, checkbox). This is used by the rtl override to add the
|
// "x-rtl" class to these elements.
|
childCls: me.getChildCls ? me.getChildCls() + ' ' : '',
|
value: renderer ? renderer.apply(me.origScope, arguments) : value
|
});
|
}
|
});
|
</pre>
|
</body>
|
</html>
|