Utils.Layers Class
Item Index
Methods
cutStringByLength
-
value
-
maxTextLength
-
cutBySpaces
Cuts string by specified length.
Parameters:
Returns:
Cutted string with ellipsis.
defaultConditionsByType
-
type
Return available conditions for filter.
Parameters:
-
type
String
Returns:
Available conditions for filter.
deserializeSortingParam
-
paramString
Convert string with sorting parameters to object.
Expected string type: '+Name1-Name2...', where: '+' and '-' - sorting direction, 'NameX' - property name for soring.
Parameters:
-
paramString
StringString with sorting parameters.
Returns:
Array objects type: { propName: 'NameX', direction: 'asc|desc' }
getRecord
-
source
-
keyName
Used for getting objects by path containing DS.RecordArray
Returns:
Retriveved object from path
Usage: controllers/my-form.js
import { getRecord } from 'ember-flexberry/utils/extended-get'l
let layer = getRecord(this, 'map.mapLayer.0.layers.1')
render
-
stringWithTemplates
-
[options]
Renders strings containing some templates inside.
Parameters:
Returns:
Rendered string (where templated parts are replaced with context's related properties).
Usage: controllers/my-form.js
import { render } from 'ember-flexberry/utils/string'l
// It will return: 'I have 1 dollar in my wallet, 2 apples in my bag, and 3 hours of free time'.
render('I have dollar in my wallet, apples in my bag, and hours of free time', {
context: { one: 1, two: 2, three: 3 }
});
// It will return: 'I have 1 dollar in my wallet, 2 apples in my bag, and 3 hours of free time'.
render('I have {% one %} dollar in my wallet, {% two %} apples in my bag, and {% three %} hours of free time', {
context: { one: 1, two: 2, three: 3 },
delimiters: ['{%', '%}']
});
serializeSortingParam
-
sorting
-
sortDefaultValue
Convert object with sorting parameters into string.
Parameters:
Returns:
String with sorting parameters.