Studio Developer Manual / Version 2010
Table Of ContentsCoreMedia Studio uses state mixins to support different component states, such as validation, readonly, highlighting, overflow behavior or text alignment. To apply a state to a component, simply implement the corresponding interface.
The following list contains state mixin interfaces, provided by CoreMedia Studio:
IValidationStateMixin
IReadOnlyStateMixin
IHighlightableMixin
IOverflowBehaviourMixin
ITextAlignMixin
State mixins provide functions to dynamically add or change CSS classes to a component. This is more robust
than simply adding a CSS class by passing it to the cls configuration
. The following example shows
how an error state can be added to a button:
private function updateButtonState():void { if(errors) { newButton.validationState = ValidationState.ERROR; } else { newButton.validationState = null; } }
Example 7.64. Set Validation State
The Studio Theme provides SCSS mixins that apply styles to CSS classes added by state mixins. Therefore, it is important to always include the Studio Theme SCSS mixin besides the ExtJS SCSS mixin. You can change styles by passing certain parameters or by setting global variables.