Initial
[qwikioffice:qwikioffice.git] / public / modules / qwiki / admin / client / lib / signups / SignupsDetail.js
1 QoDesk.QoAdmin.SignupsDetail = Ext.extend(Ext.Panel, {\r
2    signupId: null\r
3    \r
4    , constructor : function(config){\r
5         config = config || {};\r
6         \r
7       this.ownerModule = config.ownerModule;\r
8 \r
9       Ext.apply(config, {\r
10               autoScroll: true\r
11               , border: false\r
12               , height: 150\r
13               , cls: 'qo-admin-member-detail'\r
14       });\r
15       \r
16       QoDesk.QoAdmin.SignupsDetail.superclass.constructor.call(this, config);\r
17    }\r
18    \r
19    , afterRender : function(){\r
20       QoDesk.QoAdmin.SignupsDetail.superclass.afterRender.call(this);\r
21         \r
22         this.ownerPanel.on('signupedited', this.onMemberEdited, this);\r
23    }\r
24    \r
25    , getMemberId : function(){\r
26       return this.memberId;\r
27    }\r
28    \r
29    , onMemberEdited : function(record){\r
30       if(record && record.id === this.memberId){\r
31          this.updateDetail(record.data);\r
32       }\r
33    }\r
34    \r
35    , setMemberId : function(id){\r
36       if(id){\r
37          this.memberId = id;\r
38       }\r
39    }\r
40    \r
41    , updateDetail : function(data){\r
42       var tpl = new Ext.XTemplate(\r
43          '<table id="qo-admin-detail-table"><tr><td>'\r
44          , '<p><b>Name:</b> {first_name} {last_name}</p>'\r
45          , '<p><b>Email:</b> {email_address}</p>'\r
46          , '<p><b>Comments:</b></p><p>{comments}</p>'\r
47          //, '<td class="qo-admin-edit-btn"><p><button id="qo-admin-edit">Edit</button></p></td>'\r
48          , '</tr></table>'\r
49       );\r
50       tpl.overwrite(this.body, data);\r
51     }\r
52 });