Flex 2.0.1 Rating Component
April 28, 2007
Allot of online applications today presenting anything from news, to photos, to video all have a public rating feature. So here is a component that can serve as a really good start.
Originally shown as a sample in the Primitive Explorer I thought I’d break it out of that and into a post of it’s own. Mostly because as one could understand, not everyone is interested in primitives, and I’d hate to see someone reinvent code that is available.
So working off some of the work done in the Primitive Explorer I built this sample rating component. There are similar classes in this component as in the primitive explorer and I’ve made no effort to trim them down to only the necessary code. They are part of a larger package and I thought it best to keep them in tact as to not cause confusion for later updates to either. So everything in com.Primitives is part of that earlier work.
The Flex 2.0.1 Rating component can be used either stand alone or as an itemRenderer. Support for all styles listed in the PrimitiveStyles.as. Tooltips are set as an array using the tooltips property. You could create a 1-10 star rating by changing the private itemCount variable (I haven’t tried that). 5 stars is the default. If your using it in a datagrid as an itemRenderer the editorDataField should be set to “value”.
Sample and Source : Rating Component