meteoJS/base/namedCollection . NamedCollection
Source: base/
Collection-class with i18n names.
Properties
new NamedCollection(options)
Parameter
Name | Type | Optional | Description |
---|---|---|---|
options |
|
|
Options. |
Properties
count unknown
Count of the items in this collection.
- Inherited from
- module:meteoJS/base/collection.Collection#count
itemIds unknown
List of IDs (ordered list).
- Inherited from
- module:meteoJS/base/collection.Collection#itemIds
items unknown
Items (ordered list).
- Inherited from
- module:meteoJS/base/collection.Collection#items
langSortation unknown
Default order of the languages.
- Inherited from
- module:meteoJS/base/named.Named#langSortation
name unknown
Default name.
- Inherited from
- module:meteoJS/base/named.Named#name
options unknown
- Inherited from
- module:meteoJS/base/collection.Collection#options
sortFunction unknown
Sort function for the items.
- Inherited from
- module:meteoJS/base/collection.Collection#sortFunction
Methods
append(...items) → module:meteoJS/base/collection.Collection
Append an item to the collection.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
items |
|
|
New items. Value can be repeated. |
- Inherited from
- module:meteoJS/base/collection.Collection#append
- Fires
- module:meteoJS/base/collection#add:item
- module:meteoJS/base/collection#remove:item
- module:meteoJS/base/collection#replace:item
- Returns
-
This.
contains(item) → boolean
Is item appended to the collection.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
item |
|
|
Item. |
- Inherited from
- module:meteoJS/base/collection.Collection#contains
- Returns
-
If appended.
containsId(id) → boolean
Exists an ID in this collection.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
id |
|
|
ID. |
- Inherited from
- module:meteoJS/base/collection.Collection#containsId
- Returns
-
If exists.
getDefaultName() → string
Default name.
- Inherited from
- module:meteoJS/base/named.Named#getDefaultName
- Returns
getItemById(id) → module:meteoJS/base/unique.Unique
Returns item by ID, Unique-Object with undefined id, if ID doesn't exist.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
id |
|
|
ID. |
- Inherited from
- module:meteoJS/base/collection.Collection#getItemById
- Returns
-
Item.
getNameByLang([lang][, options]) → string
Returns a name, if available in the passed language, otherwise in a fallback language.
Parameters
Name | Type | Optional | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
lang |
|
Yes |
Language code. |
||||||||
options |
|
Yes |
Options. Values in
|
- Inherited from
- module:meteoJS/base/named.Named#getNameByLang
- Returns
-
Name in the passed or a fallback language.
getNameByLangNoFallback(lang) → string
Returns the name in the passed language.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
lang |
|
|
Language code. |
- Inherited from
- module:meteoJS/base/named.Named#getNameByLangNoFallback
- Returns
-
Name in the passed language.
remove(...items) → module:meteoJS/base/collection.Collection
Removes an item from the collection.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
items |
|
|
Items to remove. Value can be repeated. |
- Inherited from
- module:meteoJS/base/collection.Collection#remove
- Fires
- module:meteoJS/base/collection#remove:item
- Returns
-
This.
removeById(id) → module:meteoJS/base/collection.Collection
Removes an item by ID from the collection.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
id |
|
|
ID of the item to delete. |
- Inherited from
- module:meteoJS/base/collection.Collection#removeById
- Fires
- module:meteoJS/base/collection#remove:item
- Returns
-
This.
setNameByLang(lang, name)
Sets the name of a certain language. Pass undefined to delete name.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
lang |
|
|
Language code. |
name |
|
|
Name. |
- Inherited from
- module:meteoJS/base/named.Named#setNameByLang