APIs

Show:
Module: ember-flexberry

Methods

cutStringByLength

(
  • value
  • maxTextLength
  • cutBySpaces
)
String

Cuts string by specified length.

Parameters:

  • value String

    Specified string.

  • maxTextLength Integer

    Maximum string length.

  • cutBySpaces Boolean

    If true, string will be cutted by space.

Returns:

String:

Cutted string with ellipsis.

defaultConditionsByType

(
  • type
)
Array

Return available conditions for filter.

Parameters:

Returns:

Array:

Available conditions for filter.

deserializeSortingParam

(
  • paramString
)
Array

Convert string with sorting parameters to object.

Expected string type: '+Name1-Name2...', where: '+' and '-' - sorting direction, 'NameX' - property name for soring.

Parameters:

  • paramString String

    String with sorting parameters.

Returns:

Array:

Array objects type: { propName: 'NameX', direction: 'asc|desc' }

getRecord

(
  • source
  • keyName
)
Object

Used for getting objects by path containing DS.RecordArray

Parameters:

Returns:

Object:

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]
)
String

Renders strings containing some templates inside.

Parameters:

  • stringWithTemplates String

    String containing templates which need to be rendered

  • [options] Object optional

    Render options.

    • [context= {}] Object optional

      Rendering context containing properties which will be substituted into string instead of related templates.

    • [delimiters= ['{{', '}}']] String[] optional

      Delimiters which will be used to retrieve templated parts from the given string.

Returns:

String:

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
)
String

Convert object with sorting parameters into string.

Parameters:

  • sorting Array

    Array with objects contains sorting parameters.

  • sortDefaultValue String

    Default value for sorting parameters.

Returns:

String:

String with sorting parameters.

setRecord

(
  • source
  • keyName
  • value
)
Object

Used for setting objects properties by path containing DS.RecordArray

Parameters:

Returns:

Object:

Assigned value

Usage: controllers/my-form.js

  import { setRecord } from 'ember-flexberry/utils/setRecord'l
                      setRecord(this, 'map.mapLayer.1.visibility', false)