Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js index 8b3e6c9..51d55f4 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js | |||
@@ -1,120 +1,117 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer to http://www.clipperz.com. |
12 | 9 | ||
13 | * Javascript Crypto Library is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
14 | it and/or modify it under the terms of the GNU Affero General Public | 11 | it and/or modify it under the terms of the GNU Affero General Public |
15 | License as published by the Free Software Foundation, either version | 12 | License as published by the Free Software Foundation, either version |
16 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
17 | 14 | ||
18 | * Javascript Crypto Library is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
22 | 19 | ||
23 | * You should have received a copy of the GNU Affero General Public | 20 | * You should have received a copy of the GNU Affero General Public |
24 | License along with Javascript Crypto Library. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
25 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
26 | 23 | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.GridComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.GridComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.GridComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.GridComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._columnsManagers = args.columnsManagers; | 33 | this._columnsManagers = args.columnsManagers; |
37 | 34 | ||
38 | this._rowsObjects = []; | 35 | this._rowsObjects = []; |
39 | this._noRowsGridComponent = null; | 36 | this._noRowsGridComponent = null; |
40 | 37 | ||
41 | this._slots = { | 38 | this._slots = { |
42 | 'headerSlot':this.getId('headerSlot') | 39 | 'headerSlot':this.getId('headerSlot') |
43 | }; | 40 | }; |
44 | 41 | ||
45 | return this; | 42 | return this; |
46 | } | 43 | } |
47 | 44 | ||
48 | //============================================================================= | 45 | //============================================================================= |
49 | 46 | ||
50 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.GridComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.GridComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
51 | 48 | ||
52 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
53 | 50 | ||
54 | 'toString': function () { | 51 | 'toString': function () { |
55 | return "Clipperz.PM.UI.Web.Components.GridComponent component"; | 52 | return "Clipperz.PM.UI.Web.Components.GridComponent component"; |
56 | }, | 53 | }, |
57 | 54 | ||
58 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
59 | 56 | ||
60 | 'rows': function () { | 57 | 'rows': function () { |
61 | throw Clipperz.Base.exception.AbstractMethod; | 58 | throw Clipperz.Base.exception.AbstractMethod; |
62 | // return this._rows; | 59 | // return this._rows; |
63 | }, | 60 | }, |
64 | 61 | ||
65 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
66 | 63 | ||
67 | 'columnsManagers': function () { | 64 | 'columnsManagers': function () { |
68 | return this._columnsManagers; | 65 | return this._columnsManagers; |
69 | }, | 66 | }, |
70 | 67 | ||
71 | //------------------------------------------------------------------------- | 68 | //------------------------------------------------------------------------- |
72 | 69 | ||
73 | 'renderSelf': function(/*aContainer, aPosition*/) { | 70 | 'renderSelf': function(/*aContainer, aPosition*/) { |
74 | this.append(this.element(), [ | 71 | this.append(this.element(), [ |
75 | {tag:'div', cls:'header', children:[ | 72 | {tag:'div', cls:'header', children:[ |
76 | {tag:'form', id:this.getId('searchForm'), cls:'search', children:[ | 73 | {tag:'form', id:this.getId('searchForm'), cls:'search', children:[ |
77 | {tag:'div', cls:'search', children:[ | 74 | {tag:'div', cls:'search', children:[ |
78 | {tag:'input', type:'text', id:this.getId('search'), cls:'search', placeholder:"search", name:'textToSearch'/*, value:"clipperz"*/} | 75 | {tag:'input', type:'text', id:this.getId('search'), cls:'search', placeholder:"search", name:'textToSearch'/*, value:"clipperz"*/} |
79 | ]}, | 76 | ]}, |
80 | {tag:'div', cls:'clearSearchButton', id:this.getId('clearSearch')}, | 77 | {tag:'div', cls:'clearSearchButton', id:this.getId('clearSearch')}, |
81 | // {tag:'input', type:'button', cls:'searchButton', name:'searchButton', value:"search"}, | 78 | // {tag:'input', type:'button', cls:'searchButton', name:'searchButton', value:"search"}, |
82 | {tag:'div', cls:'headerSlot', id:this.getId('headerSlot')} | 79 | {tag:'div', cls:'headerSlot', id:this.getId('headerSlot')} |
83 | ]} | 80 | ]} |
84 | ]}, | 81 | ]}, |
85 | {tag:'div', cls:'body', children:[ | 82 | {tag:'div', cls:'body', children:[ |
86 | {tag:'div', cls:'rows', id:this.getId('rows'), children:[ | 83 | {tag:'div', cls:'rows', id:this.getId('rows'), children:[ |
87 | {tag:'table', cellpadding:'0', cellspacing:'0', cls:'rows', children:[ | 84 | {tag:'table', cellpadding:'0', cellspacing:'0', cls:'rows', children:[ |
88 | {tag:'thead', children:[ | 85 | {tag:'thead', children:[ |
89 | {tag:'tr', id:this.getId('thead_tr'), children:[]} | 86 | {tag:'tr', id:this.getId('thead_tr'), children:[]} |
90 | ]}, | 87 | ]}, |
91 | {tag:'tbody', id:this.getId('gridRows'), children:[]} | 88 | {tag:'tbody', id:this.getId('gridRows'), children:[]} |
92 | ]} | 89 | ]} |
93 | ]}, | 90 | ]}, |
94 | {tag:'div', cls:'noRowsBlock', id:this.getId('noRowsBlock'), children:[]} | 91 | {tag:'div', cls:'noRowsBlock', id:this.getId('noRowsBlock'), children:[]} |
95 | ]}, | 92 | ]}, |
96 | {tag:'div', cls:'footer'} | 93 | {tag:'div', cls:'footer'} |
97 | ]); | 94 | ]); |
98 | 95 | ||
99 | this.renderHeader(); | 96 | this.renderHeader(); |
100 | MochiKit.Signal.connect(this.getId('clearSearch'), 'onclick', this, 'clearSearchHandler'); | 97 | MochiKit.Signal.connect(this.getId('clearSearch'), 'onclick', this, 'clearSearchHandler'); |
101 | }, | 98 | }, |
102 | 99 | ||
103 | //------------------------------------------------------------------------- | 100 | //------------------------------------------------------------------------- |
104 | 101 | ||
105 | 'renderHeader': function () { | 102 | 'renderHeader': function () { |
106 | var headerElement; | 103 | var headerElement; |
107 | 104 | ||
108 | headerElement = this.getElement('thead_tr'); | 105 | headerElement = this.getElement('thead_tr'); |
109 | headerElement.innerHTML = ""; | 106 | headerElement.innerHTML = ""; |
110 | 107 | ||
111 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | 108 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { |
112 | aColumnManager.renderHeader(headerElement); | 109 | aColumnManager.renderHeader(headerElement); |
113 | }); | 110 | }); |
114 | }, | 111 | }, |
115 | 112 | ||
116 | //------------------------------------------------------------------------- | 113 | //------------------------------------------------------------------------- |
117 | 114 | ||
118 | 'update': function (someObjects) { | 115 | 'update': function (someObjects) { |
119 | this._rowsObjects = someObjects | 116 | this._rowsObjects = someObjects |
120 | this.refresh(); | 117 | this.refresh(); |