Alloy UI

aui-rating  1.0.1

 
Filters

Class ThumbRating - extends Rating

A base class for ThumbRating, providing:
  • A non-obstrusive star rating control using Thumb up and Thumb down icons
  • Could be based on a set of radio input boxes
Quick Example:
var instance = new A.ThumbRating({
boundingBox: '#rating',
defaultSelected: 3,
disabled: false,
label: 'Label'
}).render();
Check the list of Configuration Attributes available for ThumbRating.

Constructor

ThumbRating ( config )
Parameters:
config <Object> Object literal specifying widget configuration properties.

Properties

ThumbRating.ATTRS - static Object

Static property used to define the default attribute configuration for the ThumbRating.

ThumbRating.NAME - static String

Static property provides a string to identify the class.

Properties inherited from Rating:

Properties inherited from Base:

Properties inherited from Component:

Properties inherited from Attribute:

Configuration Attributes

size - Number

The size on ThumbRating is always 2 (i.e., thumb up and thumb down).
Default Value: 2

Configuration attributes inherited from Widget:

Configuration attributes inherited from Base:

Configuration attributes inherited from Component:

Methods

_syncElements

protected void _syncElements ( )
Empty method, no logic needed on this method on ThumbRating.

fillTo

void fillTo ( index , className )
Add the className on the the index element and all the previous Rating elements.
Parameters:
index <Number> Index to be selected
className <String> Class name to be applied when fill the Rating elements

renderUI

protected void renderUI ( )
Create the DOM structure for the ThumbRating. Lifecycle.

Methods inherited from Plugin.Host:

Events

sizeChange

sizeChange ( event )
Fires when the value for the configuration attribute 'size' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set