roojs-all.js
[roojs1] / examples / bootstrap / nested-dialog.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5
6 Roo.namespace('Example');
7
8 Example.NestedDialog = {
9
10     dialog : false,
11     callback:  false,
12    
13     show : function(data, cb)
14     {
15         if (!this.dialog) {
16          this.create();
17         }
18       
19         this.callback = cb;
20         this.data = data;
21         this.dialog.show( data ? this.data._el : false);
22         if (this.form) {
23          this.form.reset();
24          this.form.setValues(data);
25          this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
26         }
27    
28     },
29
30     create : function()
31     {
32         var _this = this;
33         this.dialog = Roo.factory({
34             '|xns' : 'Roo.bootstrap',
35             title : "Nested example",
36             xtype : 'Modal',
37             buttonPosition : 'center',
38             buttons : Roo.bootstrap.Modal.OKCANCEL,
39             xns : Roo.bootstrap,
40             fitwindow : true,
41             //height: 500,
42             listeners : {
43                 btnclick : function (e)
44                  {
45                      if(e == 'cancel'){
46                          _this.dialog.hide();
47                          return;
48                      }
49                      
50                      _this.form.doAction('submit');
51                  }
52            
53             },
54             items : [
55                 {
56                     xtype : 'Border',
57                     xns : Roo.bootstrap.layout,
58                      
59                     
60                     center: {
61                         xtype : 'Region',
62                         xns: Roo.bootstrap.layout,
63                         autoScroll: false,
64                         tabPosition:'top',
65                          titlebar: false
66                     },
67                     items : [
68                        
69                         {
70                             xtype : 'Content',
71                             xns: Roo.bootstrap.panel,
72                             title : "Title center 1" ,
73                             fitToFrame:true,
74                             closable:false,
75                             region : 'center',
76                             html: "center"
77                         },
78                         {
79                             xtype : 'Content',
80                             xns: Roo.bootstrap.panel,
81                             title : "Title center 2" ,
82                             fitToFrame:true,
83                             closable:false,
84                             region : 'center',
85                             html: "center2"
86                         }
87                     ]
88                 }
89             ]           
90          });
91     }
92  
93 };