var tree = Pman.Tab.BuilderTree.tree;
- if (typeof(inConfig) !== 'undefined') {
+ if (typeof(inConfig) == 'undefined') {
return;
}
var items = [];
var config = this.cloneConfig(inConfig);
+ var hidden = config['builder.hidden'] || false;
+
if (!parent) {
parent = tree.root;
}
var newNode = new Roo.tree.TreeNode({
- text: this.configToText(config)
+ text: this.configToText(config)
});
-
-
+
newNode.elConfig = config;
+
//if (markUndo === true) {
//Pman.Tab.Builder.markUndo("Add " + newNode.text);
//
parent.expand(true);
break;
}
-
+
+ newNode.ui.ctNode.style.display = hidden ? 'none' : '';
+
if (items.length) {
Roo.each(items, function(i) {
this.appendNode(newNode, i);
var newConfig = {};
for (var i in config) {
+ if (i.match(/^builder\./)) {
+ continue;
+ }
if (typeof config[i] == 'object') {
newConfig[i] = this.cloneConfig(config[i]);
} else if (typeof config[i] != 'function') { // should this happen?
var txt = [];
c = c || {};
var sr = (typeof(c['+buildershow']) != 'undefined') && !c['+buildershow'] ? true : false;
- if (sr) txt.push('<s>');
+ if (sr) {
+ txt.push('<s>');
+ }
if (typeof(c['*prop']) != 'undefined') { txt.push(c['*prop']+ ':'); }
if (c.xtype) { txt.push(c.xtype); }
if (c.fieldLabel) { txt.push('[' + c.fieldLabel + ']'); }
if (c.name) { txt.push('<b>' + c.name+ '</b>'); }
if (c.region) { txt.push('<i>(' + c.region + ')</i>'); }
if (c.dataIndex) { txt.push('[' + c.dataIndex+ ']'); }
- if (sr) txt.push('</s>');
+ if (sr) {
+ txt.push('</s>');
+ }
return (txt.length == 0 ? "Element" : txt.join(" "));
pn.removeChild(this.currentNode);
if (!pn.childNodes.length) {
- this.appendNode(pn, cfg, 'append')
+ this.appendNode(pn, cfg, 'append');
return true;
}
if (!ix) {
return true;
},
+ collapseToggle : function()
+ {
+ var tree = Pman.Tab.BuilderTree.tree;
+
+ if (this.currentNode == tree.root) {
+ return false;
+ }
+ var cfg = this.currentNode.elConfig;
+ // things that can not be deleted...
+ var hidden = cfg['builder.hidden'] || 0;
+ if (hidden) {
+ delete cfg['builder.hidden'];
+ } else {
+ cfg['builder.hidden'] = 1;
+ }
+
+
+ this.currentNode.ui.ctNode.style.display = !hidden ? 'none' : '';
+
+
+ //this.setCurrentNode(pn.childNodes.length ? pn.childNodes[ix] : pn ,true);
+ return true;
+ },
+
+
+
+
deleteCurrent : function()
{