@cntwg/html-helper 0.0.27 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -244
- package/LICENSE +1 -1
- package/README.md +17 -21
- package/doc/html-helper-lib.md +3 -3
- package/index.js +4 -41
- package/lib/html-helper-lib.js +3 -11
- package/package.json +6 -16
- package/doc/html-ctrls-btn.md +0 -263
- package/doc/html-ctrls-fields.md +0 -195
- package/doc/html-ctrls-list.md +0 -876
- package/lib/html-ctrls/buttons.js +0 -386
- package/lib/html-ctrls/fields.js +0 -521
- package/lib/html-ctrls/list.js +0 -1108
- package/lib/html-ctrls/lists-btn.js +0 -210
- package/lib/html-ctrls/lists-stubs.js +0 -297
- package/lib/html-ctrls/mod-hfunc.js +0 -60
package/doc/html-ctrls-list.md
DELETED
|
@@ -1,876 +0,0 @@
|
|
|
1
|
-
>|***rev.*:**|0.1.24|
|
|
2
|
-
>|:---|---:|
|
|
3
|
-
>|date:|2025-05-05|
|
|
4
|
-
|
|
5
|
-
## Introduction
|
|
6
|
-
|
|
7
|
-
This paper describes a classes provided by `list.js`, `lists-stubs.js` and `lists-btn.js` of `html-ctrls` sub-module.
|
|
8
|
-
|
|
9
|
-
## Module classes
|
|
10
|
-
|
|
11
|
-
<a name="THtmlItemsListContainer"></a>
|
|
12
|
-
### **THtmlItemsListContainer**
|
|
13
|
-
|
|
14
|
-
This class provide a base container useful when dealing with a list elements placed on an HTML-form.
|
|
15
|
-
|
|
16
|
-
#### class constructor
|
|
17
|
-
|
|
18
|
-
The class constructor creates a new instance of the class.
|
|
19
|
-
|
|
20
|
-
##### constructor parameters
|
|
21
|
-
|
|
22
|
-
The class constructor receives a parameters listed below:
|
|
23
|
-
|
|
24
|
-
| parameter name | value type | default value | description |
|
|
25
|
-
|:---|---|---:|:---|
|
|
26
|
-
| `host` | `HTMLElement` | `undefined` | points to a host element which holds a list items |
|
|
27
|
-
| `options` | `object` | --- | contains a container settings |
|
|
28
|
-
|
|
29
|
-
##### `options` parameter
|
|
30
|
-
|
|
31
|
-
The `options` structure has listed below:
|
|
32
|
-
|
|
33
|
-
| option name | value type | default value | description |
|
|
34
|
-
|:---|---|---:|:---|
|
|
35
|
-
| `autoHideNewItems` | `boolean` | `false` |alters behavior of the `addItem` class method. If set to `true`, the item which was added to a container members will be automatically hidden |
|
|
36
|
-
| `markCurrentItem` | `boolean` | `false` |alters behavior of the `setCurIndex` class method. If set to `true`, the item which was added to a container members will be automatically marked as current |
|
|
37
|
-
| `itemBaseClassID` | `string`, `string[]` | --- | alters behavior of the `addItem` class method. It accepts value of a string or an array of strings. For more see description of an `addItem` method |
|
|
38
|
-
|
|
39
|
-
#### class properties
|
|
40
|
-
|
|
41
|
-
<a name="THtmlItemsListContainer+count"></a>
|
|
42
|
-
##### **count**
|
|
43
|
-
|
|
44
|
-
| property type | read only | description |
|
|
45
|
-
|---|---|:---|
|
|
46
|
-
| `number` | yes | contains a quantity of the elements the container holds |
|
|
47
|
-
|
|
48
|
-
<a name="THtmlItemsListContainer+curIndex"></a>
|
|
49
|
-
##### **curIndex**
|
|
50
|
-
|
|
51
|
-
| property type | read only | description |
|
|
52
|
-
|---|---|:---|
|
|
53
|
-
| `number` | yes | represents an index of the current element |
|
|
54
|
-
|
|
55
|
-
<a name="THtmlItemsListContainer+minIndex"></a>
|
|
56
|
-
##### **minIndex**
|
|
57
|
-
|
|
58
|
-
| property type | read only | description |
|
|
59
|
-
|---|---|:---|
|
|
60
|
-
| `number` | yes | represents a minimum possible index for an element inside the container |
|
|
61
|
-
|
|
62
|
-
<a name="THtmlItemsListContainer+maxIndex"></a>
|
|
63
|
-
##### **maxIndex**
|
|
64
|
-
|
|
65
|
-
| property type | read only | description |
|
|
66
|
-
|---|---|:---|
|
|
67
|
-
| `number` | yes | represents a maximum possible index for an element inside the container |
|
|
68
|
-
|
|
69
|
-
<a name="THtmlItemsListContainer+prevIndex"></a>
|
|
70
|
-
##### **prevIndex**
|
|
71
|
-
|
|
72
|
-
| property type | read only | description |
|
|
73
|
-
|---|---|:---|
|
|
74
|
-
| `number` | yes | represents an index of the previous element before the current |
|
|
75
|
-
|
|
76
|
-
<a name="THtmlItemsListContainer+nextIndex"></a>
|
|
77
|
-
##### **nextIndex**
|
|
78
|
-
|
|
79
|
-
| property type | read only | description |
|
|
80
|
-
|---|---|:---|
|
|
81
|
-
| `number` | yes | represents an index of the next element after the current |
|
|
82
|
-
|
|
83
|
-
<a name="THtmlItemsListContainer+curItem"></a>
|
|
84
|
-
##### **curItem**
|
|
85
|
-
|
|
86
|
-
| property type | read only | description |
|
|
87
|
-
|---|---|:---|
|
|
88
|
-
| `?HTMLElement` | yes | represents an element addressed by the `curIndex` |
|
|
89
|
-
|
|
90
|
-
#### class methods
|
|
91
|
-
|
|
92
|
-
<a name="THtmlItemsListContainer+clear"></a>
|
|
93
|
-
##### **clear()** => `void`
|
|
94
|
-
|
|
95
|
-
This method deletes all items that holds by the container.
|
|
96
|
-
|
|
97
|
-
<a name="THtmlItemsListContainer+isEmpty"></a>
|
|
98
|
-
##### **isEmpty()** => `boolean`
|
|
99
|
-
|
|
100
|
-
This method returns `true` if the container has no items.
|
|
101
|
-
|
|
102
|
-
<a name="THtmlItemsListContainer+isNotEmpty"></a>
|
|
103
|
-
##### **isNotEmpty()** => `boolean`
|
|
104
|
-
|
|
105
|
-
This method returns `true` if the container has at least one item.
|
|
106
|
-
|
|
107
|
-
<a name="THtmlItemsListContainer+chkIndex"></a>
|
|
108
|
-
##### **chkIndex(value)** => `boolean`
|
|
109
|
-
|
|
110
|
-
This method returns `true` if a given `value` represents a valid index within the range of the list.
|
|
111
|
-
|
|
112
|
-
| parameter name | value type | default value | description |
|
|
113
|
-
|:---|---|---:|:---|
|
|
114
|
-
| `value` | `any` | --- | a value to be verified |
|
|
115
|
-
|
|
116
|
-
<a name="THtmlItemsListContainer+chkIndexEx"></a>
|
|
117
|
-
##### **chkIndexEx(value\[, mode])** => `boolean`\|`number`
|
|
118
|
-
|
|
119
|
-
This method is similar to a `chkIndex` methods but receives a `mode` parameter which allow to choose what a type of the result the method returns.
|
|
120
|
-
|
|
121
|
-
| parameter name | value type | default value | description |
|
|
122
|
-
|:---|---|---:|:---|
|
|
123
|
-
| `value` | `any` | --- | a value to be verified |
|
|
124
|
-
| `mode` | `boolean` | `false` | a flag to switch result value type |
|
|
125
|
-
|
|
126
|
-
The `mode` parameter treats as follows:
|
|
127
|
-
|
|
128
|
-
- if set to `false`, the result returned by the method is a `boolean` value;
|
|
129
|
-
- if set to `true`, the result returned by the method is an index;
|
|
130
|
-
- if not given or has a type of not a `boolean`, the default value is used.
|
|
131
|
-
|
|
132
|
-
<a name="THtmlItemsListContainer+srchIndex"></a>
|
|
133
|
-
##### **srchIndex(item)** => `number`
|
|
134
|
-
|
|
135
|
-
This method tries to find a given item in the list and if it is found returns its index.
|
|
136
|
-
|
|
137
|
-
| parameter name | value type | default value | description |
|
|
138
|
-
|:---|---|---:|:---|
|
|
139
|
-
| `item` | `?HTMLElement` | --- | an element to search |
|
|
140
|
-
|
|
141
|
-
<a name="THtmlItemsListContainer+srchIndexByAttr"></a>
|
|
142
|
-
##### **srchIndexByAttr(name, value)** => `number`
|
|
143
|
-
|
|
144
|
-
This method tries to find an item that has an attribute with a given `name` and `value` in the list and if it is found its index is returned.
|
|
145
|
-
|
|
146
|
-
| parameter name | value type | default value | description |
|
|
147
|
-
|:---|---|---:|:---|
|
|
148
|
-
| `name` | `string` | --- | an attribute name |
|
|
149
|
-
| `value` | `any` | --- | an attribute value |
|
|
150
|
-
|
|
151
|
-
The `value` can be a `boolean`, `number` or a `string`. If it is not given the empty string value is used. In any other cases the method will failed.
|
|
152
|
-
|
|
153
|
-
> Note: In case when a `value` is an empty string the method will accept any item with an attribute which name is equal to a given `name` regardless of a value such attribute has.
|
|
154
|
-
|
|
155
|
-
<a name="THtmlItemsListContainer+srchIndexByID"></a>
|
|
156
|
-
##### **srchIndexByID(value)** => `number`
|
|
157
|
-
|
|
158
|
-
This method tries to find an item by its `ID`-attribute in the list and if it is found returns its index (*see description of `srchIndexByAttr` method for details how a `value` parameter is used*).
|
|
159
|
-
|
|
160
|
-
| parameter name | value type | default value | description |
|
|
161
|
-
|:---|---|---:|:---|
|
|
162
|
-
| `value` | `string` | --- | an ID value |
|
|
163
|
-
|
|
164
|
-
<a name="THtmlItemsListContainer+setCurIndex"></a>
|
|
165
|
-
##### **setCurIndex(index)** => `boolean`
|
|
166
|
-
|
|
167
|
-
This method sets a current item index in the list. If succeed `true` is returned.
|
|
168
|
-
|
|
169
|
-
| parameter name | value type | default value | description |
|
|
170
|
-
|:---|---|---:|:---|
|
|
171
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
172
|
-
|
|
173
|
-
<a name="THtmlItemsListContainer+rstCurIndex"></a>
|
|
174
|
-
##### **rstCurIndex()** => `void`
|
|
175
|
-
|
|
176
|
-
This method resets a current element index in the list.
|
|
177
|
-
|
|
178
|
-
<a name="THtmlItemsListContainer+getItem"></a>
|
|
179
|
-
##### **getItem(index)** => `?HTMLElement`
|
|
180
|
-
|
|
181
|
-
This method returns an element addressed by a given `index`.
|
|
182
|
-
|
|
183
|
-
| parameter name | value type | default value | description |
|
|
184
|
-
|:---|---|---:|:---|
|
|
185
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
186
|
-
|
|
187
|
-
<a name="THtmlItemsListContainer+getItemByAttr"></a>
|
|
188
|
-
##### **getItemByAttr(name, value)** => `?HTMLElement`
|
|
189
|
-
|
|
190
|
-
This method tries to find an item by its given attribute in the list and if found returns it (*see description of `srchIndexByAttr` method for details how a `value` parameter is used*).
|
|
191
|
-
|
|
192
|
-
| parameter name | value type | default value | description |
|
|
193
|
-
|:---|---|---:|:---|
|
|
194
|
-
| `name` | `string` | --- | an attribute name |
|
|
195
|
-
| `value` | `any` | --- | an attribute value |
|
|
196
|
-
|
|
197
|
-
<a name="THtmlItemsListContainer+getItemByID"></a>
|
|
198
|
-
##### **getItemByID(value)** => `?HTMLElement`
|
|
199
|
-
|
|
200
|
-
This method tries to find an item by its `ID`-attribute in the list and if found returns it (*see description of `srchIndexByAttr` method for details how a `value` parameter is used*).
|
|
201
|
-
|
|
202
|
-
| parameter name | value type | default value | description |
|
|
203
|
-
|:---|---|---:|:---|
|
|
204
|
-
| `value` | `string` | --- | an ID value |
|
|
205
|
-
|
|
206
|
-
<a name="THtmlItemsListContainer+addItem"></a>
|
|
207
|
-
##### **addItem(item\[, options])** => `number`
|
|
208
|
-
|
|
209
|
-
This method adds a given item to a container members and if succeed returns its index.
|
|
210
|
-
|
|
211
|
-
| parameter name | value type | default value | description |
|
|
212
|
-
|:---|---|---:|:---|
|
|
213
|
-
| `item` | `HTMLElement` | --- | some element |
|
|
214
|
-
| `options` | `boolean` | `false` | a flag to switch mode |
|
|
215
|
-
|
|
216
|
-
If `options` parameter is given and is set to `true`, in case of success, the `curIndex` property is adjusted by the method.
|
|
217
|
-
|
|
218
|
-
If `itemBaseClassID` option of the container is set, the method will applied a value given by this option as a `class` attribute of an item which was successfully added.
|
|
219
|
-
|
|
220
|
-
<a name="THtmlItemsListContainer+delItem"></a>
|
|
221
|
-
##### **delItem(index\[, options\[, optEx]])** => `boolean`
|
|
222
|
-
|
|
223
|
-
This method deletes an item addressed by the given `index` from a container members and if succeed `true` is returned.
|
|
224
|
-
|
|
225
|
-
| parameter name | value type | default value | description |
|
|
226
|
-
|:---|---|---:|:---|
|
|
227
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
228
|
-
| `options` | `boolean` | `true` | a flag to switch mode |
|
|
229
|
-
| `optEx` | `boolean` | `true` | a flag to switch mode |
|
|
230
|
-
|
|
231
|
-
If `options` parameter is set to `true` (a default value), the `curIndex` property is adjusted by the method. If it is set to `false` the `curIndex` property is not adjusted before a value of the property exited out of the list indexes range that caused the property to be reset. In case the `options` is not given or is not a type of a `boolean`, its receives the default value.
|
|
232
|
-
|
|
233
|
-
<a name="THtmlItemsListContainer+selectItem"></a>
|
|
234
|
-
##### **selectItem(index\[, options])** => `boolean`
|
|
235
|
-
|
|
236
|
-
This method selects an item addressed by an `index` and if succeed `true` is returned.
|
|
237
|
-
|
|
238
|
-
| parameter name | value type | default value | description |
|
|
239
|
-
|:---|---|---:|:---|
|
|
240
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
241
|
-
| `options` | `boolean` | `false` | a flag to switch mode |
|
|
242
|
-
|
|
243
|
-
If `options` parameter is given and is set to `true`, in case of success, the `curIndex` property is adjusted by the method.
|
|
244
|
-
|
|
245
|
-
<a name="THtmlItemsListContainer+unselectItem"></a>
|
|
246
|
-
##### **unselectItem(index)** => `boolean`
|
|
247
|
-
|
|
248
|
-
This method unselects an item addressed by an `index` and if succeed `true` is returned.
|
|
249
|
-
|
|
250
|
-
| parameter name | value type | default value | description |
|
|
251
|
-
|:---|---|---:|:---|
|
|
252
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
253
|
-
|
|
254
|
-
<a name="THtmlItemsListContainer+hideItem"></a>
|
|
255
|
-
##### **hideItem(index)** => `boolean`
|
|
256
|
-
|
|
257
|
-
This method hides an item addressed by an `index` and if succeed `true` is returned.
|
|
258
|
-
|
|
259
|
-
| parameter name | value type | default value | description |
|
|
260
|
-
|:---|---|---:|:---|
|
|
261
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
262
|
-
|
|
263
|
-
<a name="THtmlItemsListContainer+showItem"></a>
|
|
264
|
-
##### **showItem(index)** => `boolean`
|
|
265
|
-
|
|
266
|
-
This method shows an item addressed by an `index` and if succeed `true` is returned.
|
|
267
|
-
|
|
268
|
-
| parameter name | value type | default value | description |
|
|
269
|
-
|:---|---|---:|:---|
|
|
270
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
271
|
-
|
|
272
|
-
<a name="THtmlItemsListContainer+isSelectedItem"></a>
|
|
273
|
-
##### **isSelectedItem(index)** => `boolean`
|
|
274
|
-
|
|
275
|
-
This method checks whether or not an item addressed by an `index` is selected and if so `true` is returned.
|
|
276
|
-
|
|
277
|
-
| parameter name | value type | default value | description |
|
|
278
|
-
|:---|---|---:|:---|
|
|
279
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
280
|
-
|
|
281
|
-
<a name="THtmlItemsListContainer+isHiddenItem"></a>
|
|
282
|
-
##### **isHiddenItem(index)** => `boolean`
|
|
283
|
-
|
|
284
|
-
This method checks whether or not an item addressed by an `index` is hidden and if so `true` is returned.
|
|
285
|
-
|
|
286
|
-
| parameter name | value type | default value | description |
|
|
287
|
-
|:---|---|---:|:---|
|
|
288
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
289
|
-
|
|
290
|
-
<a name="THtmlItemsListController"></a>
|
|
291
|
-
### **THtmlItemsListController**
|
|
292
|
-
|
|
293
|
-
This class implements a controller that provide mechanism for managing a list container and its elements placed on an HTML-form.
|
|
294
|
-
|
|
295
|
-
#### class constructor
|
|
296
|
-
|
|
297
|
-
The class constructor creates a new instance of the class.
|
|
298
|
-
|
|
299
|
-
##### constructor parameters
|
|
300
|
-
|
|
301
|
-
The class constructor receives a parameters listed below:
|
|
302
|
-
|
|
303
|
-
| parameter name | value type | default value | description |
|
|
304
|
-
|:---|---|---:|:---|
|
|
305
|
-
| `host` | `HTMLElement` | `undefined` |points to a host element which holds a list items |
|
|
306
|
-
| `options` | `object` | --- | contains a set of a settings for a container |
|
|
307
|
-
|
|
308
|
-
##### `options` parameter
|
|
309
|
-
|
|
310
|
-
The `options` structure has listed below:
|
|
311
|
-
|
|
312
|
-
| option name | value type | default value | description |
|
|
313
|
-
|:---|---|---:|:---|
|
|
314
|
-
| `autoHideNewItems` | `boolean` | `false` | for details see options on `THtmlItemsListContainer` class constructor section |
|
|
315
|
-
| `markCurrentItem` | `boolean` | `false` | for details see options on `THtmlItemsListContainer` class constructor section |
|
|
316
|
-
| `itemBaseClassID` | `string`, `string[]` | --- | for details see options on `THtmlItemsListContainer` class constructor section |
|
|
317
|
-
| `showStubsIfEmpty` | `boolean` | `false` | if set, in case of the empty list, the default stub-item will be displayed |
|
|
318
|
-
| `allowGroupSelection` | `boolean` | `false` | if set the more than one element can be selected in the list |
|
|
319
|
-
| `allowSelectionLocks` | `boolean` | `false` | \<*reserved, experimental*> |
|
|
320
|
-
|
|
321
|
-
#### class properties
|
|
322
|
-
|
|
323
|
-
<a name="THtmlItemsListController+count"></a>
|
|
324
|
-
##### **count**
|
|
325
|
-
|
|
326
|
-
| property type | read only | description |
|
|
327
|
-
|---|---|:---|
|
|
328
|
-
| `number` | yes | contains a quantity of the elements the container holds |
|
|
329
|
-
|
|
330
|
-
<a name="THtmlItemsListController+curIndex"></a>
|
|
331
|
-
##### **curIndex**
|
|
332
|
-
|
|
333
|
-
| property type | read only | description |
|
|
334
|
-
|---|---|:---|
|
|
335
|
-
| `number` | yes | represents an index of the current element |
|
|
336
|
-
|
|
337
|
-
<a name="THtmlItemsListController+minIndex"></a>
|
|
338
|
-
##### **minIndex**
|
|
339
|
-
|
|
340
|
-
| property type | read only | description |
|
|
341
|
-
|---|---|:---|
|
|
342
|
-
| `number` | yes | represents a minimum possible index for an element inside the container |
|
|
343
|
-
|
|
344
|
-
<a name="THtmlItemsListController+maxIndex"></a>
|
|
345
|
-
##### **maxIndex**
|
|
346
|
-
|
|
347
|
-
| property type | read only | description |
|
|
348
|
-
|---|---|:---|
|
|
349
|
-
| `number` | yes | represents a maximum possible index for an element inside the container |
|
|
350
|
-
|
|
351
|
-
<a name="THtmlItemsListController+prevIndex"></a>
|
|
352
|
-
##### **prevIndex**
|
|
353
|
-
|
|
354
|
-
| property type | read only | description |
|
|
355
|
-
|---|---|:---|
|
|
356
|
-
| `number` | yes | represents an index of the previous element before the current |
|
|
357
|
-
|
|
358
|
-
<a name="THtmlItemsListController+nextIndex"></a>
|
|
359
|
-
##### **nextIndex**
|
|
360
|
-
|
|
361
|
-
| property type | read only | description |
|
|
362
|
-
|---|---|:---|
|
|
363
|
-
| `number` | yes | represents an index of the next element after the current |
|
|
364
|
-
|
|
365
|
-
<a name="THtmlItemsListController+curItem"></a>
|
|
366
|
-
##### **curItem**
|
|
367
|
-
|
|
368
|
-
| property type | read only | description |
|
|
369
|
-
|---|---|:---|
|
|
370
|
-
| `?HTMLElement` | yes | represents an element addressed by the `curIndex` |
|
|
371
|
-
|
|
372
|
-
<a name="THtmlItemsListController+isSelectionLocked"></a>
|
|
373
|
-
##### **isSelectionLocked**
|
|
374
|
-
|
|
375
|
-
| property type | read only | description |
|
|
376
|
-
|---|---|:---|
|
|
377
|
-
| `boolean` | yes | returns `true` if selections of an items is not allowed |
|
|
378
|
-
|
|
379
|
-
<a name="THtmlItemsListController+SelectedItems"></a>
|
|
380
|
-
##### **SelectedItems**
|
|
381
|
-
|
|
382
|
-
| property type | read only | description |
|
|
383
|
-
|---|---|:---|
|
|
384
|
-
| `HTMLElement[]` | yes | returns an array of the selected elements |
|
|
385
|
-
|
|
386
|
-
<a name="THtmlItemsListController+StubItems"></a>
|
|
387
|
-
##### **StubItems**
|
|
388
|
-
|
|
389
|
-
| property type | read only | description |
|
|
390
|
-
|---|---|:---|
|
|
391
|
-
| `THtmlStubItemsSet` | yes | returns a `THtmlStubItemsSet` instance |
|
|
392
|
-
|
|
393
|
-
#### class methods
|
|
394
|
-
|
|
395
|
-
<a name="THtmlItemsListController+clear"></a>
|
|
396
|
-
##### **clear()** => `void`
|
|
397
|
-
|
|
398
|
-
This method deletes all items that is hold by the list.
|
|
399
|
-
|
|
400
|
-
<a name="THtmlItemsListController+lockItemsSelection"></a>
|
|
401
|
-
##### **lockItemsSelection()** => `void`
|
|
402
|
-
|
|
403
|
-
This method blocks a selection of the items in the list.
|
|
404
|
-
|
|
405
|
-
<a name="THtmlItemsListController+unlockItemsSelection"></a>
|
|
406
|
-
##### **unlockItemsSelection()** => `void`
|
|
407
|
-
|
|
408
|
-
This method allows a selection of the items in the list.
|
|
409
|
-
|
|
410
|
-
<a name="THtmlItemsListContainer+isEmpty"></a>
|
|
411
|
-
##### **isEmpty()** => `boolean`
|
|
412
|
-
|
|
413
|
-
This method returns `true` if the list has no items.
|
|
414
|
-
|
|
415
|
-
<a name="THtmlItemsListContainer+isNotEmpty"></a>
|
|
416
|
-
##### **isNotEmpty()** => `boolean`
|
|
417
|
-
|
|
418
|
-
This method returns `true` if the list has at least one item.
|
|
419
|
-
|
|
420
|
-
<a name="THtmlItemsListContainer+chkIndex"></a>
|
|
421
|
-
##### **chkIndex(value)** => `boolean`
|
|
422
|
-
|
|
423
|
-
This method returns `true` if a given value represent a valid index within the range of the list.
|
|
424
|
-
|
|
425
|
-
| parameter name | value type | default value | description |
|
|
426
|
-
|:---|---|---:|:---|
|
|
427
|
-
| `value` | `any` | --- | a value to be verified |
|
|
428
|
-
|
|
429
|
-
<a name="THtmlItemsListContainer+chkIndexEx"></a>
|
|
430
|
-
##### **chkIndexEx(value\[, mode])** => `boolean`\|`number`
|
|
431
|
-
|
|
432
|
-
This method is similar to a `chkIndex` methods but receives a `mode` parameter which allow to choose what a type of the result the method returns.
|
|
433
|
-
|
|
434
|
-
| parameter name | value type | default value | description |
|
|
435
|
-
|:---|---|---:|:---|
|
|
436
|
-
| `value` | `any` | --- | a value to be verified |
|
|
437
|
-
| `mode` | `boolean` | `false` | a flag to switch result value type |
|
|
438
|
-
|
|
439
|
-
If `mode` parameter set to `false` (*its default value*), the result returned by the method is a `boolean` value.
|
|
440
|
-
|
|
441
|
-
If `mode` parameter set to `true`, the result returned by the method has an index type.
|
|
442
|
-
|
|
443
|
-
<a name="THtmlItemsListContainer+srchIndex"></a>
|
|
444
|
-
##### **srchIndex(item)** => `number`
|
|
445
|
-
|
|
446
|
-
This method tries to find a given item in the list and if it is found returns its index.
|
|
447
|
-
|
|
448
|
-
| parameter name | value type | default value | description |
|
|
449
|
-
|:---|---|---:|:---|
|
|
450
|
-
| `item` | `?HTMLElement` | --- | an element to search |
|
|
451
|
-
|
|
452
|
-
<a name="THtmlItemsListContainer+srchIndexByAttr"></a>
|
|
453
|
-
##### **srchIndexByAttr(name, value)** => `number`
|
|
454
|
-
|
|
455
|
-
This method tries to find an item by its given attribute in the list and if it is found returns its index.
|
|
456
|
-
|
|
457
|
-
| parameter name | value type | default value | description |
|
|
458
|
-
|:---|---|---:|:---|
|
|
459
|
-
| `name` | `string` | --- | an attribute name |
|
|
460
|
-
| `value` | `any` | --- | an attribute value |
|
|
461
|
-
|
|
462
|
-
<a name="THtmlItemsListContainer+srchIndexByID"></a>
|
|
463
|
-
##### **srchIndexByID(value)** => `number`
|
|
464
|
-
|
|
465
|
-
This method tries to find an item by its `ID`-attribute in the list and if it is found returns its index.
|
|
466
|
-
|
|
467
|
-
| parameter name | value type | default value | description |
|
|
468
|
-
|:---|---|---:|:---|
|
|
469
|
-
| `value` | `string` | --- | an ID value |
|
|
470
|
-
|
|
471
|
-
<a name="THtmlItemsListController+setCurIndex"></a>
|
|
472
|
-
##### **setCurIndex(index)** => `boolean`
|
|
473
|
-
|
|
474
|
-
This method sets a current item index in the list. If succeed `true` is returned.
|
|
475
|
-
|
|
476
|
-
| parameter name | value type | default value | description |
|
|
477
|
-
|:---|---|---:|:---|
|
|
478
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
479
|
-
|
|
480
|
-
<a name="THtmlItemsListController+rstCurIndex"></a>
|
|
481
|
-
##### **rstCurIndex()** => `void`
|
|
482
|
-
|
|
483
|
-
This method resets a current item index in the list.
|
|
484
|
-
|
|
485
|
-
<a name="THtmlItemsListContainer+getItem"></a>
|
|
486
|
-
##### **getItem(index)** => `?HTMLElement`
|
|
487
|
-
|
|
488
|
-
This method returns an item addressed by a given index.
|
|
489
|
-
|
|
490
|
-
| parameter name | value type | default value | description |
|
|
491
|
-
|:---|---|---:|:---|
|
|
492
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
493
|
-
|
|
494
|
-
<a name="THtmlItemsListContainer+getItemByAttr"></a>
|
|
495
|
-
##### **getItemByAttr(name, value)** => `?HTMLElement`
|
|
496
|
-
|
|
497
|
-
This method tries to find an item by its given attribute in the list and if found returns it.
|
|
498
|
-
|
|
499
|
-
| parameter name | value type | default value | description |
|
|
500
|
-
|:---|---|---:|:---|
|
|
501
|
-
| `name` | `string` | --- | an attribute name |
|
|
502
|
-
| `value` | `any` | --- | an attribute value |
|
|
503
|
-
|
|
504
|
-
<a name="THtmlItemsListContainer+getItemByID"></a>
|
|
505
|
-
##### **getItemByID(value)** => `?HTMLElement`
|
|
506
|
-
|
|
507
|
-
This method tries to find an item by its `ID`-attribute in the list and if found returns it.
|
|
508
|
-
|
|
509
|
-
| parameter name | value type | default value | description |
|
|
510
|
-
|:---|---|---:|:---|
|
|
511
|
-
| `value` | `string` | --- | an ID value |
|
|
512
|
-
|
|
513
|
-
<a name="THtmlItemsListController+addItem"></a>
|
|
514
|
-
##### **addItem(item\[, options])** => `number`
|
|
515
|
-
|
|
516
|
-
This method adds a given item to a list members and if succeed returns its index.
|
|
517
|
-
|
|
518
|
-
| parameter name | value type | default value | description |
|
|
519
|
-
|:---|---|---:|:---|
|
|
520
|
-
| `item` | `HTMLElement` | --- | some element |
|
|
521
|
-
| `options` | `boolean` | `false` | a flag to switch mode |
|
|
522
|
-
|
|
523
|
-
<a name="THtmlItemsListController+delItem"></a>
|
|
524
|
-
##### **delItem(index\[, options])** => `boolean`
|
|
525
|
-
|
|
526
|
-
This method deletes an item addressed by `index` from a list members and if succeed `true` is returned.
|
|
527
|
-
|
|
528
|
-
| parameter name | value type | default value | description |
|
|
529
|
-
|:---|---|---:|:---|
|
|
530
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
531
|
-
| `options` | `boolean` | `true` | a flag to switch mode |
|
|
532
|
-
|
|
533
|
-
<a name="THtmlItemsListController+selectItem"></a>
|
|
534
|
-
##### **selectItem(index\[, options])** => `boolean`
|
|
535
|
-
|
|
536
|
-
This method selects an item addressed by an `index` and if succeed `true` is returned.
|
|
537
|
-
|
|
538
|
-
| parameter name | value type | default value | description |
|
|
539
|
-
|:---|---|---:|:---|
|
|
540
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
541
|
-
| `options` | `boolean` | `false` | a flag to switch mode |
|
|
542
|
-
|
|
543
|
-
<a name="THtmlItemsListController+unselectItem"></a>
|
|
544
|
-
##### **unselectItem(index)** => `boolean`
|
|
545
|
-
|
|
546
|
-
This method unselects an item addressed by an `index` and if succeed `true` is returned.
|
|
547
|
-
|
|
548
|
-
| parameter name | value type | default value | description |
|
|
549
|
-
|:---|---|---:|:---|
|
|
550
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
551
|
-
|
|
552
|
-
<a name="THtmlItemsListController+hideItem"></a>
|
|
553
|
-
##### **hideItem(index)** => `boolean`
|
|
554
|
-
|
|
555
|
-
This method hides an item addressed by an `index` and if succeed `true` is returned.
|
|
556
|
-
|
|
557
|
-
<a name="THtmlItemsListController+showItem"></a>
|
|
558
|
-
##### **showItem(index)** => `boolean`
|
|
559
|
-
|
|
560
|
-
This method shows an item addressed by an `index` and if succeed `true` is returned.
|
|
561
|
-
|
|
562
|
-
| parameter name | value type | default value | description |
|
|
563
|
-
|:---|---|---:|:---|
|
|
564
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
565
|
-
|
|
566
|
-
<a name="THtmlItemsListContainer+isSelectedItem"></a>
|
|
567
|
-
##### **isSelectedItem(index)** => `boolean`
|
|
568
|
-
|
|
569
|
-
This method checks whether or not an item addressed by an `index` is selected and if so `true` is returned.
|
|
570
|
-
|
|
571
|
-
| parameter name | value type | default value | description |
|
|
572
|
-
|:---|---|---:|:---|
|
|
573
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
574
|
-
|
|
575
|
-
<a name="THtmlItemsListContainer+isHiddenItem"></a>
|
|
576
|
-
##### **isHiddenItem(index)** => `boolean`
|
|
577
|
-
|
|
578
|
-
This method checks whether or not an item addressed by an `index` is hidden and if so `true` is returned.
|
|
579
|
-
|
|
580
|
-
| parameter name | value type | default value | description |
|
|
581
|
-
|:---|---|---:|:---|
|
|
582
|
-
| `index` | `number`, `string` | --- | an element index |
|
|
583
|
-
|
|
584
|
-
<a name="THtmlItemsListController+on"></a>
|
|
585
|
-
##### **on(name, event)** => `void`
|
|
586
|
-
|
|
587
|
-
This method sets event handler for the list event addressed by a `name` parameter.
|
|
588
|
-
|
|
589
|
-
| parameter name | value type | default value | description |
|
|
590
|
-
|:---|---|---:|:---|
|
|
591
|
-
| `name` | `string` | --- | an event name |
|
|
592
|
-
| `event` | `function` | --- | a callback function |
|
|
593
|
-
|
|
594
|
-
> Note: for current implementation you can't reset or set new event handler (especially another one) if a handler with the same name exists already.
|
|
595
|
-
|
|
596
|
-
#### class events
|
|
597
|
-
|
|
598
|
-
The class generates the events listed in the table bellow:
|
|
599
|
-
|
|
600
|
-
| event name | description |
|
|
601
|
-
|:---|:---|
|
|
602
|
-
| `list-clear` | fired if the list is cleared or a last item was removed |
|
|
603
|
-
| `first-item-added` | fired when a first item was added to the list. This event will occur before `item-added` event was triggered |
|
|
604
|
-
| `item-added` | fired when an item was added to the list |
|
|
605
|
-
| `item-removed` | fired when an item was deleted from the list. It will not occur in case the item is the last. |
|
|
606
|
-
| `current-item-chosen` | fired when an item was chosen as current |
|
|
607
|
-
| `item-selected` | fired when an item was marked as selected in the list |
|
|
608
|
-
| `item-unselected` | fired when an item was unmarked as selected in the list |
|
|
609
|
-
| `item-hidden` | fired when an item was marked as hidden in the list |
|
|
610
|
-
| `item-shown` | fired when an item was marked as non-hidden in the list |
|
|
611
|
-
|
|
612
|
-
<a name="THtmlStubItemsSet"></a>
|
|
613
|
-
### **THtmlStubItemsSet**
|
|
614
|
-
|
|
615
|
-
This class implements a controller that provide mechanism for managing a so-called "stub"-elements displayed inside an attached list container placed on an HTML-form.
|
|
616
|
-
|
|
617
|
-
#### class constructor
|
|
618
|
-
|
|
619
|
-
The class constructor creates a new instance of the class.
|
|
620
|
-
|
|
621
|
-
##### constructor parameters
|
|
622
|
-
|
|
623
|
-
The class constructor receives a parameters listed below:
|
|
624
|
-
|
|
625
|
-
| parameter name | value type | default value | description |
|
|
626
|
-
|:---|---|---:|:---|
|
|
627
|
-
| `host` | `HTMLElement` | --- | points to a host element which holds a list items |
|
|
628
|
-
| `options` | `object`, `array` | --- | contains an object that is send to a class `loadItems` method |
|
|
629
|
-
|
|
630
|
-
> \[!] NOTE: `[since v0.0.26]` a use of a `array` type as a value of an `options` are deprecated and will be dropped soon.
|
|
631
|
-
|
|
632
|
-
##### `options` parameter
|
|
633
|
-
|
|
634
|
-
The `options` structure has listed below:
|
|
635
|
-
|
|
636
|
-
| option name | value type | default value | description |
|
|
637
|
-
|:---|---|---:|:---|
|
|
638
|
-
| `items` | `array`, `object` | --- | defines a list of the entries to load. For more details see a description of a [`loadItems`](#THtmlStubItemsSet+loadItems) class method |
|
|
639
|
-
| `defaultItem` | `string` | --- | if set it defines a name of the item used by default |
|
|
640
|
-
| `force` | `boolean` | `false` | if set to `true`, the item which is already present will be replaced with a new one |
|
|
641
|
-
|
|
642
|
-
#### class properties
|
|
643
|
-
|
|
644
|
-
<a name="THtmlStubItemsSet+count"></a>
|
|
645
|
-
##### **count**
|
|
646
|
-
|
|
647
|
-
| property type | read only | description |
|
|
648
|
-
|---|---|:---|
|
|
649
|
-
| `number` | yes | contains a quantity of an elements which holds by the set |
|
|
650
|
-
|
|
651
|
-
<a name="THtmlStubItemsSet+defItem"></a>
|
|
652
|
-
##### **defItem**
|
|
653
|
-
|
|
654
|
-
| property type | read only | description |
|
|
655
|
-
|---|---|:---|
|
|
656
|
-
| `string` | no | defines an element name which is used by default |
|
|
657
|
-
|
|
658
|
-
#### class methods
|
|
659
|
-
|
|
660
|
-
<a name="THtmlStubItemsSet+clear"></a>
|
|
661
|
-
##### **clear()** => `void`
|
|
662
|
-
|
|
663
|
-
This class method deletes all items hold by the set.
|
|
664
|
-
|
|
665
|
-
<a name="THtmlStubItemsSet+hasItem"></a>
|
|
666
|
-
##### **hasItem(name)** => `boolean`
|
|
667
|
-
|
|
668
|
-
This class method returns `true` if an item named by `name` exists in the set and `false` if else.
|
|
669
|
-
|
|
670
|
-
| parameter name | value type | default value | description |
|
|
671
|
-
|:---|---|---:|:---|
|
|
672
|
-
| `name` | `string` | --- | an element name |
|
|
673
|
-
|
|
674
|
-
<a name="THtmlStubItemsSet+hasItems"></a>
|
|
675
|
-
##### **hasItems()** => `boolean`
|
|
676
|
-
|
|
677
|
-
This class method returns `true` if the set hold any items and `false` if not.
|
|
678
|
-
|
|
679
|
-
<a name="THtmlStubItemsSet+getItem"></a>
|
|
680
|
-
##### **getItem(name)** => `?HTMLElement`
|
|
681
|
-
|
|
682
|
-
This class method returns an item named by `name` if it exists in the set and `null` if else.
|
|
683
|
-
|
|
684
|
-
| parameter name | value type | default value | description |
|
|
685
|
-
|:---|---|---:|:---|
|
|
686
|
-
| `name` | `string` | --- | an element name |
|
|
687
|
-
|
|
688
|
-
<a name="THtmlStubItemsSet+addItem"></a>
|
|
689
|
-
##### **addItem(name, item\[, options])** => `boolean`
|
|
690
|
-
|
|
691
|
-
This class method tries to include a given `item` to a set members with a label given by `name` and if succeed returns `true`.
|
|
692
|
-
|
|
693
|
-
| parameter name | value type | default value | description |
|
|
694
|
-
|:---|---|---:|:---|
|
|
695
|
-
| `name` | `string` | --- | an element name |
|
|
696
|
-
| `item` | `HTMLElement` | --- | an element |
|
|
697
|
-
| `options` | `boolean` | `false` | flag that defines whether to run in `force`-mode |
|
|
698
|
-
|
|
699
|
-
The `actForce` parameter if given alters the method behavior:
|
|
700
|
-
|
|
701
|
-
- If set to `true` it force replacements of an existing item which label is equal to `name`;
|
|
702
|
-
- If set to `false` and item with the same label already exists the method will failed;
|
|
703
|
-
- If parameter is not given or not of a `boolean` type its default value meant to be `false`.
|
|
704
|
-
|
|
705
|
-
<a name="THtmlStubItemsSet+delItem"></a>
|
|
706
|
-
##### **delItem(name)** => `boolean`
|
|
707
|
-
|
|
708
|
-
This class method tries to delete item named by `name` from the set and if succeed `true` is returned.
|
|
709
|
-
|
|
710
|
-
| parameter name | value type | default value | description |
|
|
711
|
-
|:---|---|---:|:---|
|
|
712
|
-
| `name` | `string` | --- | an element name |
|
|
713
|
-
|
|
714
|
-
<a name="THtmlStubItemsSet+showItem"></a>
|
|
715
|
-
##### **showItem(name)** => `boolean`
|
|
716
|
-
|
|
717
|
-
This class method tries to make item named by `name` visible on HTML-form and if succeed `true` is returned.
|
|
718
|
-
|
|
719
|
-
| parameter name | value type | default value | description |
|
|
720
|
-
|:---|---|---:|:---|
|
|
721
|
-
| `name` | `string` | --- | an element name |
|
|
722
|
-
|
|
723
|
-
<a name="THtmlStubItemsSet+hideItem"></a>
|
|
724
|
-
##### **hideItem(name)** => `boolean`
|
|
725
|
-
|
|
726
|
-
This class method tries to make item named by `name` invisible on HTML-form and if succeed `true` is returned.
|
|
727
|
-
|
|
728
|
-
| parameter name | value type | default value | description |
|
|
729
|
-
|:---|---|---:|:---|
|
|
730
|
-
| `name` | `string` | --- | an element name |
|
|
731
|
-
|
|
732
|
-
<a name="THtmlStubItemsSet+setDefItem"></a>
|
|
733
|
-
##### **setDefItem(name)** => `boolean`
|
|
734
|
-
|
|
735
|
-
This class method tries to set item named by `name` as a default item and if succeed `true` is returned.
|
|
736
|
-
|
|
737
|
-
| parameter name | value type | default value | description |
|
|
738
|
-
|:---|---|---:|:---|
|
|
739
|
-
| `name` | `string` | --- | an element name |
|
|
740
|
-
|
|
741
|
-
<a name="THtmlStubItemsSet+rstDefItem"></a>
|
|
742
|
-
##### **rstDefItem()** => `void`
|
|
743
|
-
|
|
744
|
-
This class method resets a default item.
|
|
745
|
-
|
|
746
|
-
<a name="THtmlStubItemsSet+showDefItem"></a>
|
|
747
|
-
##### **showDefItem()** => `boolean`
|
|
748
|
-
|
|
749
|
-
This class method is similar to `showItem` method but is performed on a default item.
|
|
750
|
-
|
|
751
|
-
<a name="THtmlStubItemsSet+hideDefItem"></a>
|
|
752
|
-
##### **hideDefItem()** => `boolean`
|
|
753
|
-
|
|
754
|
-
This class method is similar to `hideItem` method but is performed on a default item.
|
|
755
|
-
|
|
756
|
-
<a name="THtmlStubItemsSet+loadItems"></a>
|
|
757
|
-
##### **loadItems(data\[, options])** => `number`
|
|
758
|
-
|
|
759
|
-
This class methods loads an items given by `list` in the set and returned quantity of how many items have been processed successfully.
|
|
760
|
-
|
|
761
|
-
| parameter name | value type | default value | description |
|
|
762
|
-
|:---|---|---:|:---|
|
|
763
|
-
| `data` | `array`, `object` | --- | an array of entries or a special descriptive object |
|
|
764
|
-
| `options` | `boolean`, `object` | --- | an options |
|
|
765
|
-
|
|
766
|
-
> \[!] NOTE: *`[since v0.0.25]`* the use of a booleans as an `options` value is deprecated and will be dropped soon.
|
|
767
|
-
|
|
768
|
-
If the `data` parameter is an `object` that contains the following set of values:
|
|
769
|
-
|
|
770
|
-
| option name | value type | default value | description |
|
|
771
|
-
|:---|---|---:|:---|
|
|
772
|
-
| `items` | `array` | `undefined` | defines a list of the entries to load. Each entry contains a `name`-`element` pair. |
|
|
773
|
-
| `defaultItem` | `string` | --- | if set it defines a name of the item used by default |
|
|
774
|
-
|
|
775
|
-
If the `data` parameter is an `array` it used as value of a `data.items` options.
|
|
776
|
-
|
|
777
|
-
Note that each element of a `data.items` can be:
|
|
778
|
-
|
|
779
|
-
- an `array` which contains a `key-value` pair
|
|
780
|
-
|
|
781
|
-
'[ \<*`item name`*>, \<*`object`*> ]'
|
|
782
|
-
|
|
783
|
-
- an `object`:
|
|
784
|
-
|
|
785
|
-
'{ **name**: \<*`item name`*>, **item**: \<*`object`*>}'
|
|
786
|
-
|
|
787
|
-
If the `options` parameter is an `object` that contains the following set of parameters:
|
|
788
|
-
|
|
789
|
-
| option name | value type | default value | description |
|
|
790
|
-
|:---|---|---:|:---|
|
|
791
|
-
| `defaultItem` | `string` | --- | (*deprecated **since `v0.0.26`***) if set it defines a name of the item used by default |
|
|
792
|
-
| `useClear` | `boolean` | `true` | if set to `true`, before the load of the items, the list is cleared |
|
|
793
|
-
| `force` | `boolean` | `false` | if set to `true`, the item which is already present will be replaced with a new one |
|
|
794
|
-
|
|
795
|
-
If the `options` parameter is a `boolean` value it treats as a `options.useClear` option.
|
|
796
|
-
|
|
797
|
-
<a name="THtmlListButtonsController"></a>
|
|
798
|
-
### **THtmlListButtonsController**
|
|
799
|
-
|
|
800
|
-
This class provides a buttons controller to use with a list components to performs actions for list elements selection.
|
|
801
|
-
|
|
802
|
-
#### class constructor
|
|
803
|
-
|
|
804
|
-
The class constructor creates a new instance of the class.
|
|
805
|
-
|
|
806
|
-
##### constructor parameters
|
|
807
|
-
|
|
808
|
-
The class constructor receives an `options` parameter which structure has listed below:
|
|
809
|
-
|
|
810
|
-
| option name | option type | default value | description |
|
|
811
|
-
|:---|---|---:|:---|
|
|
812
|
-
| `btnFirst` | `?HTMLElement` | `undefined` | defines an HTML-button which will select the first element |
|
|
813
|
-
| `btnPrev` | `?HTMLElement` | `undefined` | defines an HTML-button which will select the previous element |
|
|
814
|
-
| `btnNext` | `?HTMLElement` | `undefined` | defines an HTML-button which will select the next element |
|
|
815
|
-
| `btnLast` | `?HTMLElement` | `undefined` | defines an HTML-button which will select the last element |
|
|
816
|
-
|
|
817
|
-
#### class properties
|
|
818
|
-
|
|
819
|
-
This class has none.
|
|
820
|
-
|
|
821
|
-
#### class methods
|
|
822
|
-
|
|
823
|
-
<a name="THtmlListButtonsController+disableAll"></a>
|
|
824
|
-
##### **disableAll()** => `void`
|
|
825
|
-
|
|
826
|
-
This method disables all buttons that holds by the controller.
|
|
827
|
-
|
|
828
|
-
<a name="THtmlListButtonsController+disableBkwd"></a>
|
|
829
|
-
##### **disableBkwd()** => `void`
|
|
830
|
-
|
|
831
|
-
This method disables all buttons in *'move backward'* group (*i.e. `btnFirst` and `btnPrev`*) that holds by the controller.
|
|
832
|
-
|
|
833
|
-
<a name="THtmlListButtonsController+disableFrwd"></a>
|
|
834
|
-
##### **disableFrwd()** => `void`
|
|
835
|
-
|
|
836
|
-
This method disables all buttons in *'move forward'* group (*i.e. `btnNext` and `btnLast`*) that holds by the controller.
|
|
837
|
-
|
|
838
|
-
<a name="THtmlListButtonsController+enableAll"></a>
|
|
839
|
-
##### **enableAll()** => `void`
|
|
840
|
-
|
|
841
|
-
This method enables all buttons that holds by the controller.
|
|
842
|
-
|
|
843
|
-
<a name="THtmlListButtonsController+enableBkwd"></a>
|
|
844
|
-
##### **enableBkwd()** => `void`
|
|
845
|
-
|
|
846
|
-
This method enables all buttons in *'move backward'* group (*i.e. `btnFirst` and `btnPrev`*) that holds by the controller.
|
|
847
|
-
|
|
848
|
-
<a name="THtmlListButtonsController+enableFrwd"></a>
|
|
849
|
-
##### **enableFrwd()** => `void`
|
|
850
|
-
|
|
851
|
-
This method enables all buttons in *'move forward'* group (*i.e. `btnNext` and `btnLast`*) that holds by the controller.
|
|
852
|
-
|
|
853
|
-
#### class methods (*special*)
|
|
854
|
-
|
|
855
|
-
<a name="THtmlListButtonsController+on"></a>
|
|
856
|
-
##### **on(name, event)** => `void`
|
|
857
|
-
|
|
858
|
-
This method sets event handler addressed by a `name` parameter.
|
|
859
|
-
|
|
860
|
-
| parameter name | value type | default value | description |
|
|
861
|
-
|:---|---|---:|:---|
|
|
862
|
-
| `name` | `string` | --- | an event name |
|
|
863
|
-
| `event` | `function` | --- | a callback function |
|
|
864
|
-
|
|
865
|
-
> Note: for current implementation you can't reset or set new event handler (*especially another one*) if a handler with the same name exists already.
|
|
866
|
-
|
|
867
|
-
#### class events
|
|
868
|
-
|
|
869
|
-
The class generates the events listed in the table bellow:
|
|
870
|
-
|
|
871
|
-
| event name | description |
|
|
872
|
-
|:---|:---|
|
|
873
|
-
| `btn-first-pressed` | fired if the `btnFirst` was pressed |
|
|
874
|
-
| `btn-prev-pressed` | fired if the `btnPrev` was pressed |
|
|
875
|
-
| `btn-next-pressed` | fired if the `btnNext` was pressed |
|
|
876
|
-
| `btn-last-pressed` | fired if the `btnLast` was pressed |
|