Popover overhall - with example
[roojs1] / examples / bootstrap / popover.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.Popover');
6
7 Pman.Popover.FileTest= function() {}
8 Roo.apply(Pman.Popover.FileTest.prototype, {
9
10  _strings : {
11   '897356954c2cd3d41b221e3f24f99bba' :"Key",
12   '689202409e48743b914713f96d93947c' :"Value",
13   '5a105e8b9d40e1329780d62ea2265d8a' :"test1",
14   'd1e2284f2f77494e8ed6bcb990bf6072' :"Brand here"
15  },
16
17  dialog : false,
18  callback:  false,
19
20  show : function(data, cb)
21  {
22   if (!this.dialog) {
23    this.create();
24   }
25   
26   this.callback = cb;
27   this.data = data;
28   this.dialog.show.apply(this.dialog,  Array.prototype.slice.call(arguments).slice(2));
29   if (this.form) {
30    this.form.reset();
31    this.form.setValues(data);
32    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
33   }
34
35  },
36
37  create : function()
38  {
39   var _this = this;
40   this.dialog = Roo.factory({
41     xtype : 'Popover',
42     modal : false,
43     placement : 'right',
44     style : 'width:500px',
45     cls: 'p-0',
46     listeners : {
47      show : function (_self)
48       {
49           _this.grid.ds.load({});
50            this.updatePosition.defer(100,this);
51       }
52     },
53     xns : Roo.bootstrap,
54     '|xns' : 'Roo.bootstrap',
55     items  : [
56      {
57       xtype : 'Table',
58        listeners : {
59        render : function (_self)
60         {
61             _this.grid = this;
62         }
63       },
64       xns : Roo.bootstrap,
65       '|xns' : 'Roo.bootstrap',
66       store : {
67        xtype : 'SimpleStore',
68        data : [
69            [ 'NG1234:', 'Wanchai' ],
70            [ 'NG1234:', 'Central' ],
71            [ 'NG1234:', 'North Point' ],
72            [ 'NG1234:', 'Causeway Bay' ],
73            [ 'NG1234:', 'Eastern' ]
74        ],
75        fields : [ 'code' , 'name' ],
76        isLocal : true,
77        listeners : {
78         load : function (_self, records, options)
79          {
80           
81          }
82        },
83        xns : Roo.data,
84        '|xns' : 'Roo.data'
85       },
86       cm : [
87        {
88         xtype : 'ColumnModel',
89         header : _this._strings['897356954c2cd3d41b221e3f24f99bba'] /* Key */,
90         xns : Roo.grid,
91         '|xns' : 'Roo.grid'
92        },
93        {
94         xtype : 'ColumnModel',
95         header : _this._strings['689202409e48743b914713f96d93947c'] /* Value */,
96         xns : Roo.grid,
97         '|xns' : 'Roo.grid'
98        }
99       ]
100      },
101      {
102       xtype : 'PopoverNav',
103       style : 'flex-direction: row;',
104       type : 'pills',
105       xns : Roo.bootstrap,
106       '|xns' : 'Roo.bootstrap',
107       items  : [
108        {
109         xtype : 'Element',
110         cls : 'navbar-brand',
111         html : _this._strings['d1e2284f2f77494e8ed6bcb990bf6072'] /* Brand here */,
112         xns : Roo.bootstrap,
113         '|xns' : 'Roo.bootstrap'
114        },
115        {
116         xtype : 'NavGroup',
117         align : 'right',
118         pilltype : false,
119         type : 'pills',
120         xns : Roo.bootstrap,
121         '|xns' : 'Roo.bootstrap',
122         items  : [
123          {
124           xtype : 'NavItem',
125           button_outline : true,
126           button_weight : 'primary',
127           fa : 'download',
128           html : _this._strings['5a105e8b9d40e1329780d62ea2265d8a'] /* test1 */,
129           xns : Roo.bootstrap,
130           '|xns' : 'Roo.bootstrap'
131          },
132          {
133           xtype : 'NavItem',
134           fa : 'times',
135           linkcls : 'pr-0',
136           listeners : {
137            click : function (e)
138             {
139                 _this.dialog.hide();
140             }
141           },
142           xns : Roo.bootstrap,
143           '|xns' : 'Roo.bootstrap'
144          }
145         ]
146        }
147       ]
148      }
149     ]
150    }  );
151  }
152 });
153 Roo.apply(Pman.Popover.FileTest, Pman.Popover.FileTest.prototype);