API/libsapojs/SAPO/Component/Rating

[Elements] are optional

Class SAPO.Component.Rating


class SAPO.Component.Rating
Defined in Component/Rating/1.1/lib.js

Constructor Summary
Rating (string element, string elmMessages, string hash, Object options, Number defaultRating)
Provides a rating meter

Constructor Details

constructor Rating

Rating(string element, string elmMessages, string hash, Object options, Number defaultRating)
Provides a rating meter
Parameters:
element - id of the element where the rating will be shown
elmMessages - DOM Element where the messages appear
hash - hash value to be passed on the AJAX call
options - Options for the rating meter
  • [ Number total ] - Number of rating options
  • [ string image ] - Image for empty rating
  • [ string imageOver ] - Image for half rating
  • [ string imageHalf ] - Image for full rating
  • [ boolean logged ] - if the user is logged
  • [ Array messages ] - messages for each rating level
  • [ string url ] - URL where the rating results should be submitted to
  • [ method ] - HTTP method for the call
  • [ variable ] - HTTP variable where the rate result will be stored
  • [ hashVariable ] - HTTP variable where the hash will be stored
defaultRating - default rating value (from 0 to 100)