dojox/form/Rating.js

  • Provides:

    • dojox.form.Rating
  • Requires:

    • dijit.form._FormWidget in common in project dijit
  • dojox.form.Rating

    • type
      Function
    • chains:
      • dijit.form._FormWidget: (prototype)
      • dijit.form._FormWidget: (call)
    • summary
      A widget for rating using stars.
      
      required: Boolean
      TODO: Can be true or false, default is false.
      required: false,
  • dojox.form.Rating.templateString

    • summary
  • dojox.form.Rating.numStars

    • type
      Integer/Float
    • summary
      The number of stars to show, default is 3.
  • dojox.form.Rating.value

    • type
      Integer/Float
    • summary
      The current value of the Rating
  • dojox.form.Rating.constructor

    • summary
  • dojox.form.Rating.postCreate

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        this._renderStars(this.value);
    • summary
  • dojox.form.Rating._onMouse

    • type
      Function
    • parameters:
      • evt: (typeof )
    • source: [view]
        if(this.hovering){
         var hoverValue = +dojo.attr(evt.target, "value");
         this.onMouseOver(evt, hoverValue);
         this._renderStars(hoverValue, true);
        }else{
         this._renderStars(this.value);
        }
    • summary
  • dojox.form.Rating._renderStars

    • type
      Function
    • parameters:
      • value: (typeof )
      • hover: (typeof )
    • source: [view]
        dojo.query(".dojoxRatingStar", this.domNode).forEach(function(star, i){
         if(i + 1 > value){
          dojo.removeClass(star, "dojoxRatingStarHover");
          dojo.removeClass(star, "dojoxRatingStarChecked");
         }else{
          dojo.removeClass(star, "dojoxRatingStar" + (hover ? "Checked" : "Hover"));
          dojo.addClass(star, "dojoxRatingStar" + (hover ? "Hover" : "Checked"));
         }
        });
    • summary
      Render the stars depending on the value.
  • dojox.form.Rating.onStarClick

    • summary
  • dojox.form.Rating.onMouseOver

    • type
      Function
    • source: [view]
        // summary: Connect here, the value is passed to this function as the second parameter!
    • summary
      Connect here, the value is passed to this function as the second parameter!
  • dojox.form.Rating.setAttribute

    • type
      Function
    • parameters:
      • key: (typeof String)
      • value: (typeof )
    • source: [view]
        this.inherited("setAttribute", arguments);
        if (key=="value"){
         this._renderStars(this.value);
         this.onChange(this.value); // Do I really have to call this by hand? :-(
        }
    • summary
      When calling setAttribute("value", 4), set the value and render the stars accordingly.
  • this

    • mixins:
      • params: (normal)
    • summary
  • dojox.form

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary