DataObjects/builder.sql
[Pman.Builder] / Pman.Tab.BuilderPalette.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Tab.BuilderPalette = new Roo.XComponent({
6     part     :  ["Builder","Palette"],
7     order    : '001-Pman.Tab.BuilderPalette',
8     region   : 'center',
9     parent   : 'Pman.Tab.BuilderTab',
10     name     : "Pman.Tab.BuilderPalette",
11     disabled : false, 
12     permname : '', 
13     _tree : function()
14     {
15         var _this = this;
16         var MODULE = this;
17         return {
18             xtype: 'GridPanel',
19             xns: Roo,
20             listeners : {
21                 activate : function() {
22                     _this.panel = this;
23                     if (_this.grid) {
24                        _this.grid.ds.load({})
25                     }
26                 }
27             },
28             background : true,
29             fitContainer : true,
30             fitToframe : true,
31             region : 'east',
32             tableName : 'palette',
33             title : "palette",
34             grid : {
35                 xtype: 'Grid',
36                 xns: Roo.grid,
37                 listeners : {
38                     render : function() 
39                     {
40                         _this.grid = this; 
41                         //_this.dialog = Pman.Dialog.FILL_IN
42                         if (_this.panel.active) {
43                            this.ds.load({})
44                         }
45                         if (_this.ss) {
46                             return;
47                         }
48                         _this.ss =   Roo.util.CSS.createStyleSheet(
49                     '.pman-builder-palete-hide { display: none; } ' + "\n" 
50                     , Roo.id())
51                         
52                         
53                         
54                     },
55                     rowclass : function (gridview, rowcfg)
56                     {
57                         var sn = Pman.Builder.Tree.currentNodeType();
58                       //  Roo.log(rowcfg);
59                         if (!sn) {
60                             sn = '*top';
61                         }
62                         var cls = 'pman-builder-palete-hide';
63                        
64                      
65                         Roo.each(rowcfg.record.json.parents, function(n) {
66                             if (n == sn || n.split(':').shift() == sn) 
67                                 cls = '';
68                                 return true;
69                             }
70                          );
71                          //Roo.log(cls);
72                          rowcfg.rowClass = cls;
73                         // what is the currently selected element..
74                      
75                     }
76                 },
77                 autoExpandColumn : 'name',
78                 ddGroup : 'component',
79                 enableDrag : true,
80                 loadMask : true,
81                 dataSource : {
82                     xtype: 'Store',
83                     xns: Roo.data,
84                     remoteSort : true,
85                     sortInfo : { field : 'name', direction: 'ASC' },
86                     proxy : {
87                         xtype: 'HttpProxy',
88                         xns: Roo.data,
89                         method : 'GET',
90                         url : baseURL + '/Builder/Palette.php'
91                     },
92                     reader : {
93                         xtype: 'JsonReader',
94                         xns: Roo.data,
95                         id : 'id',
96                         root : 'data',
97                         totalProperty : 'total',
98                         fields : [
99                             
100                             {
101                                 'name': 'name',
102                                 'type': 'string'
103                             }
104                         ]
105                     }
106                 },
107                 colModel : [
108                     {
109                         xtype: 'ColumnModel',
110                         xns: Roo.grid,
111                         dataIndex : 'name',
112                         header : 'Name',
113                         width : 200,
114                         renderer : function(v) { return String.format('{0}', v); }
115                     }
116                 ],
117                 sm : {
118                     xtype: 'RowSelectionModel',
119                     xns: Roo.grid,
120                     singleSelect : true
121                 }
122             }
123         };
124     }
125 });