Popover overhall - with example
[roojs1] / examples / bootstrap / modal-layout.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Dialog');
6
7 Pman.Dialog.FileView= function() {}
8 Roo.apply(Pman.Dialog.FileView.prototype, {
9
10  _strings : {
11   'd7778d0c64b6ba21494c97f77a66885a' :"Filter",
12   '689202409e48743b914713f96d93947c' :"Value",
13   '5b31f5026bb07829f7a815555dbf91ae' :"File Preview XXX.pdf"
14  },
15
16  dialog : false,
17  callback:  false,
18
19  show : function(data, cb)
20  {
21   if (!this.dialog) {
22    this.create();
23   }
24
25   this.callback = cb;
26   this.data = data;
27   this.dialog.show(this.data._el);
28   if (this.form) {
29    this.form.reset();
30    this.form.setValues(data);
31    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
32   }
33
34  },
35
36  create : function()
37  {
38   var _this = this;
39   this.dialog = Roo.factory({
40     xtype : 'Modal',
41     fitwindow : true,
42     title : _this._strings['5b31f5026bb07829f7a815555dbf91ae'] /* File Preview XXX.pdf */,
43     listeners : {
44      show : function (_self)
45       {
46           _this.dialog.items[0].getRegion('center').showPanel(0);
47       }
48     },
49     xns : Roo.bootstrap,
50     '|xns' : 'Roo.bootstrap',
51     items  : [
52      {
53       xtype : 'Border',
54       xns : Roo.bootstrap.layout,
55       '|xns' : 'Roo.bootstrap.layout',
56       center : {
57        xtype : 'Region',
58        xns : Roo.bootstrap.layout,
59        '|xns' : 'Roo.bootstrap.layout'
60       },
61       west : {
62        xtype : 'Region',
63        split : true,
64        width : 250,
65        xns : Roo.bootstrap.layout,
66        '|xns' : 'Roo.bootstrap.layout'
67       },
68       items  : [
69        {
70         xtype : 'Grid',
71         fitContainer : true,
72         fitToFrame : true,
73         region : 'west',
74         listeners : {
75          activate : function (_self)
76           {
77             
78           }
79         },
80         xns : Roo.bootstrap.panel,
81         '|xns' : 'Roo.bootstrap.panel',
82         grid : {
83          xtype : 'Table',
84          rowSelection : true,
85          striped : true,
86          listeners : {
87           render : function (_self)
88            {
89                _this.grid = this;
90            }
91          },
92          xns : Roo.bootstrap,
93          '|xns' : 'Roo.bootstrap',
94          store : {
95           xtype : 'SimpleStore',
96           data : [
97               [ 'Project:', '' ],
98               [ 'ER No.:', '' ],
99               [ 'School Code:', '' ],
100               [ 'District:', '' ] 
101           ],
102           fields : [ 'filter' , 'value' ],
103           isLocal : true,
104           xns : Roo.data,
105           '|xns' : 'Roo.data'
106          },
107          sm : {
108           xtype : 'RowSelectionModel',
109           singleSelect : true,
110           listeners : {
111            selectionchange : function (_self)
112             {
113                 _this.addBtn.hide();
114                 _this.removeBtn.hide();
115             
116                 var s = this.getSelected();
117                 if (!s) { return; }
118             
119                 _this.preview.setUrl( baseURL + '/Preview/' + s.data.id + '.html'); 
120                 
121                 if (s.data.is_approved) { 
122                     _this.removeBtn.show();
123                 } else {
124                     _this.addBtn.show();
125                 }
126                 
127             }
128           },
129           xns : Roo.bootstrap.Table,
130           '|xns' : 'Roo.bootstrap.Table'
131          },
132          cm : [
133           {
134            xtype : 'ColumnModel',
135            dataIndex : 'fname',
136            header : _this._strings['d7778d0c64b6ba21494c97f77a66885a'] /* Filter */,
137            sm : 6,
138            xns : Roo.grid,
139            '|xns' : 'Roo.grid'
140           },
141           {
142            xtype : 'ColumnModel',
143            dataIndex : 'is_approved',
144            header : _this._strings['689202409e48743b914713f96d93947c'] /* Value */,
145            renderer : function(v,x,r) {
146                
147                return v;
148            },
149            sm : 6,
150            xns : Roo.grid,
151            '|xns' : 'Roo.grid'
152           }
153          ]
154         }
155        },
156        {
157         xtype : 'Content',
158         region : 'center',
159         xns : Roo.bootstrap.panel,
160         '|xns' : 'Roo.bootstrap.panel'
161        }
162       ]
163      }
164     ]
165    }  );
166  }
167 });
168 Roo.apply(Pman.Dialog.FileView, Pman.Dialog.FileView.prototype);