1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
7 // register the module first
8 Pman.on('beforeload', function()
11 modKey : '001-Pman.Tab.BuilderProps',
12 module : Pman.Tab.BuilderProps,
14 parent : Pman.Tab.BuilderTree,
15 name : "Pman.Tab.BuilderProps",
21 Pman.Tab.BuilderProps = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
38 xtype: 'PropertyGrid',
41 render : function (grid)
45 afteredit : function (e)
48 //this.currentNode.elConfig
52 cellclick : function (_self, rowIndex, ci, e)
58 // click on left col..
60 // make sure it's initialized..
61 _this.panel.menu = Roo.factory(_this.panel.menu);
63 _this.panel.menu.show(e.getTarget(), 'tr');
65 beforeedit : function (e)
67 Roo.log('beforeedit');
68 Roo.log(e.record.data);
69 var key = e.record.data.name;
70 var val = e.record.data.value;
72 if (key.match(/^\|/) || key.match(/^\!/)) {
73 Pman.Dialog.BuilderSourceEdit.show( { value : val }, function(d) {
74 // perhaps we should eval it..
76 _this.grid.currentNode.elConfig[key] = d.value;
77 _this.grid.setSourceFromNode(_this.grid.currentNode.elConfig);
78 _this.grid.fireEvent('propertychange',
79 Pman.Tab.BuilderProps.grid, key, d.value, false
86 propertychange : function (grid, id, v, oldval)
94 _this.grid.currentNode.elConfig[id] = v;
95 var bp = Pman.Tab.BuilderView.panel;
96 bp.redraw.defer(100,bp, [true]);
97 _this.grid.currentNode.setText(
98 Pman.Tab.BuilderTree.tree.configToText(_this.grid.currentNode.elConfig)
102 setCurrrentNode : function(node) {
105 this.view.el.unmask();
107 if (!node || !node.elConfig) {
108 this.currentNode = false;
109 this.setSourceFromNode({});
110 this.view.el.mask('select a node');
112 this.currentNode = node;
113 this.setSourceFromNode(this.currentNode.elConfig);
118 setSourceFromNode : function(config) {
122 for (var k in config) {
123 //if (k.charAt(0) == '*') {
124 // continue; // dont show props..
127 if (k == 'listeners') {
128 for (var kk in config[k]) {
129 cfg['!' + kk ] = config[k][kk];
138 if (typeof config[k] == 'object') {
141 var ec = Roo.encode(config[k]);
167 activate : function (_self)
171 click : function (_self, e)
173 var rc = _this.grid.getSelectionModel().getSelectedCell();
174 var n = _this.grid.getDataSource().getAt(rc[0]).data.name;
179 delete _this.grid.currentNode.elConfig.listeners[n.substring(1)];
181 delete _this.grid.currentNode.elConfig[n];
184 _this.grid.setCurrrentNode(_this.grid.currentNode);
185 var bp = Pman.Tab.BuilderView.panel;
186 bp.redraw.defer(100,bp, [true]);
187 // update the tree's text
188 _this.currentNode.setText(
189 Pman.Tab.BuilderTree.tree.configToText(_this.currentNode.elConfig)
193 text : "Delete Property / Event"
198 this.layout = this.panel.layout;