FlexberryDropdownComponent Class
addon/components/flexberry-dropdown.js:13
Dropdown component based on Semantic UI Dropdown module.
Item Index
Methods
getTargetObjectByCondition.
-
condition
Returns that 'targetObject' (from 'targetObject's hierarchy) which satisfies a given condition.
let controller = this.getTargetObjectByCondition((targetObject) => {
return targetObject instanceof Controller;
});
Parameters:
-
condition
FunctionCallback-function, which will be called for each 'targetObject' in 'targetObject's hierarchy, until callback return true for one of them.
Returns:
Target object which satisfies a given condition or null.
initProperty
-
options
Initializes component's property with recpect to following priority: 1 - template-defined parameters, 2 - applicaion configuration-defined parameters (JSON from ./config/environment by path defined in 'appConfigSettingsPath' property), 3 - component-defined defaults. Note! It is important to be declared as undefined for those component properties, which will be initialized through 'initProperty' call.
// ./config/environment.js.
module.exports = function(environment) {
var ENV = {
APP: {
components: {
myComponent: {
myComponentProperty: 'myComponentProperty config-defined default value',
}
}
}
};
return ENV;
};
// /components/my-component.js
import FlexberryBaseComponent from 'ember-flexberry/flexberry-base-component';
export default FlexberryBaseComponent.extend({
appConfigSettingsPath: 'APP.components.myComponent',
myComponentProperty: undefined,
init() {
this._super.apply(this, arguments);
this.initProperty({ propertyName: 'myComponentProperty', defaultValue: 'myComponentProperty default value' });
}
});
onShowHide
()
Properties
appConfigSettings
Object
Component settings object from application configuration (part of JSON from ./config/environment.js). Part of appConfig related to appConfigSettingsPath.
Default: null
appConfigSettingsPath
String
Path to component's settings in application configuration (JSON from ./config/environment.js).
Default: APP.components.flexberryDropdown
currentController
Controller
Current controller.
Default: null
displayCaptions
Boolean
Flag indicates whether to display captions for dropdown items. To make it work, "items" property should have following structure: { item1: 'caption for item1', item2: 'caption for item2' } For example, user will see 'caption for item1', but on choose, item1 is set to 'value' property.
Default: false
dynamicProperties
Object
Component dynamic properties ({ componentPropertyName: value }). Used when component renders dynamically with ember {{component}} helper: {{component 'my-component' value=value dynamicProperties=myConponentProperties}}. In the end of component initialization its properties values will be replaced with values from this object.
Default: null
needChecksOnValue
Boolean
Flag indicates whether to make checks on selected value or not.
It has false
value when component loads data by request by semantic processes.
It is not recommended to change its value out of addon.
Default: true
placeholder
String
Placeholder or default text (will be displayed if there is no selected item).
Default: t('components.flexberry-dropdown.placeholder')
readonlyAttr
String | Undefined
Readonly HTML attribute following to the readonly
query param. According to the W3C standard, returns 'readonly' if readonly
is true
and undefined
otherwise.
text
Any
Selected item or placeholder.
value
Any
Selected item.