FlexberryDdauCheckboxComponent Class
addon/components/flexberry-ddau-checkbox.js:33
Flexberry checkbox component with Semantic UI checkbox style and "Data Down Actions UP (DDAU)" pattern one way binding. Component doesn't mutate passed value by its own, it only invokes 'change' action, which signalizes to the route, controller, or another component, that passed value should be mutated.
Usage with manual 'change' action handling: templates/my-form.hbs
{{flexberry-ddau-checkbox
value=model.flag
change=(action "onModelFlagChange")
}}
controllers/my-form.js
actions: {
onModelFlagChange(e) {
// Set new value to model's 'flag' property.
this.set('model.flag', e.newValue);
// Log jQuery 'change' event object triggered after checkbox input was clicked.
console.log(e.originalEvent);
}
}
Usage with {{#crossLink "FlexberryDdauCheckboxActionsHandlerMixin"}}flexberry-ddau-checkbox-actions-handler mixin{{/crossLink}}:
{{flexberry-ddau-checkbox
value=model.flag
change=(action "onCheckboxChange" "model.flag")
}}
controllers/my-form.js
import Controller from '@ember/controller';
import FlexberryDdauCheckboxActionsHandlerMixin from 'ember-flexberry/mixins/flexberry-ddau-checkbox-actions-handler';
export default Controller.extend(FlexberryDdauCheckboxActionsHandlerMixin, {
});
Item Index
Methods
Properties
Methods
_actionHandlerIsDefined
-
options
Parameters:
Returns:
_addDynamicProperty
-
propertyName
Parameters:
-
propertyName
StringName of dynamic property that must be added.
_dynamicPropertiesDidChange
()
private
_removeDynamicProperties
()
private
_removeDynamicProperty
-
propertyName
Parameters:
-
propertyName
StringName of dynamic property that must be removed.
actions.change
-
e
Handles inner input's bubbled 'change' action. Invokes component's FlexberryDdauCheckbox/sendingActions.change:method action.
Parameters:
-
e
ObjectjQuery event object which describes inner input's 'change' event.
actions.sendButtonAction
-
action
Call action of a clicked button.
attachEventHandler
-
options
Parameters:
-
options
ObjectMethod options.-
eventTarget
ObjectDOM-element (jQuery-object) for which event-handler must be attached.
-
eventName
StringEvent name.
-
eventHandler
FunctionEvent handler.
-
closeModalDialog
()
createdModalDialog
-
modalDialog
Parameters:
-
modalDialog
JQueryCreated modal window.
detachAllEventHandlers
()
detachEventHandler
-
options
Parameters:
-
options
ObjectMethod options.-
eventTarget
ObjectDOM-element (jQuery-object) from which event-handler must be detached.
-
eventName
StringEvent name.
-
eventHandler
FunctionEvent handler.
-
send
-
actionName
-
args
`
Parameters:
-
actionName
StringName of the action that must be triggered. -
args
Arguments that must be passed to action.
Returns:
sendingActions.change
-
e
Component's action invoking when checkbox was clicked and it's 'checked' state changed.
Parameters:
-
e
ObjectAction's event object.
-
newValue
BooleanComponent's new value.
-
originalEvent
ObjectjQuery event object which describes inner input's 'change' event.
-
Properties
_availableDomEvents
Object
private
_componentWrapperIsAvailable
Boolean
private
_dynamicActions
Object
private
_dynamicPropertiesMetadata
Object[]
private
Default: null
_eventsMetadata
Object[]
private
Default: null
_openedModalDialog
JQuery
Default: undefined
_requiredActions
String[]
Component's required actions names. For actions enumerated in this array an assertion exceptions will be thrown, if actions handlers are not defined for them.
Default: ['change']
classNameBindings
String[]
Components class names bindings.
Default: ['value:checked', 'readonly:read-only']
classNames
String[]
Component's wrapping
Any other CSS-classes can be added through component's 'class' property.
{{flexberry-ddau-checkbox class="toggle" value=model.flag change=(action "onModelFlagChange")}}
Default: ['flexberry-checkbox', 'ui', 'checkbox']
dynamicActions
DynamicActionObject[]
Default: null
dynamicProperties
Object
Default: null
flexberryClassNames
Object
static
Component's CSS-classes names. JSON-object containing string constants with CSS-classes names related to component's .hbs markup elements.
Sub-properties:
-
prefix
StringComponent's CSS-class names prefix ('flexberry-button').
-
wrapper
StringComponent's wrapping
CSS-class name ('flexberry-button').
Object staticflexberryClassNames
Component's CSS-classes names. JSON-object containing string constants with CSS-classes names related to component's .hbs markup elements.
Sub-properties:
-
prefix
StringComponent's CSS-class names prefix ('flexberry-checkbox').
-
wrapper
StringComponent's wrapping
CSS-class name ('flexberry-checkbox').checkboxInput
StringComponent's inner CSS-class name ('flexberry-checkbox-input').
checkboxCaption
StringComponent's inner
BooleanisTagless
Flag: indicates whether component is tagless or not (has empty [tagName](https://emberjs.com/api/ember/release/classes/Component#property_tagName) or not).
-