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 _this.panel.menu.show(e.getTarget(), 'tr');
62 beforeedit : function (e)
64 Roo.log('beforeedit');
65 Roo.log(e.record.data);
66 var key = e.record.data.name;
67 var val = e.record.data.value;
68 if (key.match(/^\|/) || key.match(/^\!/)) {
69 Pman.Dialog.BuilderSourceEdit.show( { value : val }, function(d) {
70 _this.grid.currentNode.elConfig[key] = val;
71 _this.grid.setSourceFromNode(_this.grid.currentNode.elConfig);
72 _this.grid.fireEvent('propertychange',
73 Pman.Tab.BuilderProps.grid, key, val, false
80 propertychange : function (grid, id, v, oldval)
88 _this.grid.currentNode.elConfig[id] = v;
89 var bp = Pman.Tab.BuilderView.panel;
90 bp.redraw.defer(100,bp, [true]);
91 _this.grid.currentNode.setText(
92 Pman.Tab.BuilderTree.tree.configToText(_this.grid.currentNode.elConfig)
96 setCurrrentNode : function(node) {
99 this.view.el.unmask();
101 if (!node || !node.elConfig) {
102 this.currentNode = false;
103 this.setSourceFromNode({});
104 this.view.el.mask('select a node');
106 this.currentNode = node;
107 this.setSourceFromNode(this.currentNode.elConfig);
112 setSourceFromNode : function(config) {
116 for (var k in config) {
117 //if (k.charAt(0) == '*') {
118 // continue; // dont show props..
121 if (k == 'listeners') {
122 for (var kk in config[k]) {
123 cfg['!' + kk ] = config[k][kk];
132 if (typeof config[k] == 'object') {
135 var ec = Roo.encode(config[k]);
161 click : function (_self, e)
163 var rc = _this.grid.getSelectionModel().getSelectedCell();
164 var n = _this.grid.getDataSource().getAt(rc[0]).data.name;
169 delete _this.grid.currentNode.elConfig.listeners[n.substring(1)];
171 delete _this.grid.currentNode.elConfig[n];
174 _this.grid.setCurrrentNode(_this.currentNode);
175 var bp = Pman.Tab.BuilderView.panel;
176 bp.redraw.defer(100,bp, [true]);
177 // update the tree's text
178 _this.currentNode.setText(
179 Pman.Tab.BuilderTree.tree.configToText(_this.currentNode.elConfig)
183 text : "Delete Property / Event"
188 this.layout = this.panel.layout;