Class type Goog.​Ui.​ratings

class type ratings = object..end

Inherits


method decoreInternal : 
'a. (#Dom_html.element as 'a) Js.t -> unit Js.meth

Decorate a HTML structure already in the document. Expects the structure:

  • div
  • select
  • option 1 #text = 1 star
  • option 2 #text = 2 stars
  • option 3 #text = 3 stars
  • option N (where N is max number of ratings)

The div can contain other elements for graceful degredation, but they will be hidden when the decoration occurs.

method enterDocument : unit Js.meth

Render the rating widget inside the provided element. This will override the current content of the element.

method exitDocument : unit Js.meth

Should be called when the widget is removed from the document but may be reused. This removes all the listeners the widget has attached and destroys.

method disposeInternal : unit Js.meth
method getCssClass : Js.js_string Js.t Js.meth

Returns the base CSS class used by subcomponents of this component. Returns Component-specific CSS class.

method setSelectedIndex : int -> unit Js.meth

Sets the selected index. If the provided index is greater than the number of ratings then the max is set. 0 is the first item, -1 is no selection.

method getSelectedIndex : int Js.meth

Returns The index of the currently selected rating.

method getValue : Js.js_string Js.t Js.meth

Returns the rating value of the currently selected rating. Returns The value of the currently selected rating (or null).

method getHighlightedIndex : int Js.meth

Returns the index of the currently highlighted rating, -1 if the mouse isn't currently over the widget. Returns The index of the currently highlighted rating.

method getHighlightedValue : Js.js_string Js.t Js.meth

Returns the value of the currently highlighted rating, null if the mouse isn't currently over the widget. Returns The value of the currently highlighted rating, or null.

method setRatings : string Js.js_array Js.t -> unit Js.meth

Sets the array of ratings that the comonent.

method getRatings : string Js.js_array Js.t Js.meth

Gets the array of ratings that the component. Returns Array of ratings.

method setAttachedFormField : 
'b. (#Dom_html.element as 'b) Js.t -> unit Js.meth

Attaches an input or select element to the ratings widget. The value or index of the field will be updated along with the ratings widget.

method getAttachedFormField : Dom_html.element Js.t Js.meth

Returns the attached input or select element to the ratings widget. Returns The attached form field.