// Auto generated file - created by app.Builder.js- do not edit directly (at present!)
-
-
-// register the module first
-Pman.on('beforeload', function()
-{
- Pman.register({
- part : ["Builder","Tree"],
- modKey : '001-Pman.Tab.BuilderTree',
- module : Pman.Tab.BuilderTree,
- region : 'center',
- parent : Pman.Tab.BuilderTab,
- name : "Pman.Tab.BuilderTree",
- disabled : false,
- permname: ''
- });
-});
-
-Pman.Tab.BuilderTree = new Roo.util.Observable({
-
- panel : false,
- disabled : false,
- parentLayout: false,
-
- add : function(parentLayout, region)
+Pman.Tab.BuilderTree = new Roo.XComponent({
+ part : ["Builder","Tree"],
+ order : '001-Pman.Tab.BuilderTree',
+ region : 'center',
+ parent : 'Pman.Tab.BuilderTab',
+ name : "Pman.Tab.BuilderTree",
+ disabled : false,
+ permname : '',
+ _tree : function()
{
-
var _this = this;
- this.parentLayout = parentLayout;
-
- this.panel = parentLayout.addxtype({
+ var MODULE = this;
+ return {
xtype: 'NestedLayoutPanel',
xns: Roo,
region : 'west',
}
_this.hasMouseEvent = true;
- this.el.on('mouseover', function() { _this.isMouseOver= true; });
- this.el.on('mouseout', function() { _this.isMouseOver = false; });
+ // this.el.on('mouseover', function() { _this.isMouseOver= true; });
+ // this.el.on('mouseout', function() { _this.isMouseOver = false; });
}
},
{
e.preventDefault();
// console.log(e.button);
- Pman.BuilderTree.setCurrentNode(node);
+ Pman.Builder.Tree.setCurrentNode(node);
enableDD : true,
rootVisible : true,
renderer : function(n) { return n.text; },
- setCurrentNode : function(node,select) {
- this.currentNode = node || this.root;
-
- //Pman.Tab.BuilderView.highlightElement(this.currentNode);
-
- var p = Pman.Tab.BuilderProps.grid;
- if (p) { //may not be ready yet..
- p.setCurrrentNode(this.currentNode);
- }
-
-
- this.currentNode.setText(this.configToText(this.currentNode.elConfig));
-
- if (select) { //&& node !== this.tree.root) {
- if (this.currentNode !== this.root) {
- this.currentNode.ensureVisible();
- }
- this.currentNode.expand(false,false);
- this.currentNode.select();
- }
- // update palete..
- Pman.Tab.BuilderPalette.grid.getSelectionModel().clearSelections();
- Pman.Tab.BuilderPalette.grid.view.refresh();
-
- },
- toJS : function(n)
- {
- if (!n) {
- return this.toJS(this.root);
- }
- var _this = this;
- var ret = this.cloneConfig(n.elConfig);
- if (n.childNodes.length) {
- ret.items = [];
- n.eachChild(function(cn) {
- ret.items.push(_this.toJS(cn));
- });
-
- }
- return ret;
-
-
- },
sm : {
xtype: 'DefaultSelectionModel',
xns: Roo.tree
xtype: 'Menu',
xns: Roo.menu,
items : [
+ {
+ xtype: 'Item',
+ xns: Roo.menu,
+ listeners : {
+ click : function (_self)
+ {
+
+ var str = Pman.Builder.Tree.currentNodeType();
+ if (typeof(Pman.Builder.Wizard[str]) == 'undefined') {
+ Roo.MessageBox.alert("Sorry", "No wizard exists for " + str);
+ return;
+ }
+ var cn = Pman.Builder.Tree.currentNode;
+ if (typeof(cn.elConfig['.builderCfg']) == 'undefined') {
+ Roo.MessageBox.alert("Sorry", "No configuration exists for " + str);
+ return;
+ }
+
+
+ var cfg = Roo.decode(cn.elConfig['.builderCfg']);
+
+ Roo.log(cfg);
+ Pman.Dialog.BuilderAddTable.show(
+ cfg,
+ function(data) {
+
+
+ var res = Pman.Builder.Wizard[str](data); // with old..
+ Pman.Builder.Tree.replaceCurrentNode( res );
+ Pman.Tab.BuilderView.panel.redraw();
+
+ }
+ );
+
+
+ // otherwise, call back with template??
+
+
+
+
+ }
+ },
+ text : "Edit Using Wizard"
+ },
+ {
+ xtype: 'Separator',
+ xns: Roo.menu
+ },
+ {
+ xtype: 'Item',
+ xns: Roo.menu,
+ listeners : {
+ click : function (_self)
+ {
+
+
+ Pman.Builder.Tree.collapseToggle();
+
+ }
+ },
+ text : "Toggle Collapse"
+ },
+ {
+ xtype: 'Item',
+ xns: Roo.menu,
+ listeners : {
+ click : function (_self)
+ {
+
+
+ Pman.Builder.Tree.createSharedPart();
+
+ }
+ },
+ text : "Create shared part from this node"
+ },
+ {
+ xtype: 'Separator',
+ xns: Roo.menu
+ },
{
xtype: 'Item',
xns: Roo.menu,
if (r!='yes') {
return;
}
- _this.tree.deleteCurrent();
+ Pman.Builder.Tree.deleteCurrent();
}
);
split : true
}
}
- });
- this.layout = this.panel.layout;
-
+ };
}
});