Rate

Override defaults with $.fn.rate.defaults.

Dependencies

  • None

Usage

Create Rate from markup.

Create Rate using javascript.

Properties

Name Type Description Default
value number The field value. 0
max number The max star count. 5
size number The size of the rating stars. 24
half boolean Defines if to allow semi selection. false
disabled boolean Defines if to disable the field. false
readonly boolean Defines if the component is read-only. false
color string The default star color. #ececec
selectedColor string The selected star color. #ffca3e

Events

Name Parameters Description
onChange newValue,oldValue Fires when the field value is changed.

Methods

Name Parameter Description
options none Return the options object.
destroy none Destroy the rate component.
disable none Disable the component.
enable none Enable the component.
readonly mode Enable/Disable readonly mode.

Code example:

$('#tb').rate('readonly');	// enable readonly mode
$('#tb').rate('readonly',true);	// enable readonly mode
$('#tb').rate('readonly',false);	// disable readonly mode
clear none Clear the component value.
reset none Reset the component value.
initValue value Initialize the component value. Calling this method does not trigger the 'onChange' event.
setValue value Set the component value.
getValue none Get the component value.