views:

33

answers:

1

I am using a star rating plugin with ExtJS that is working well, but I need to reset the displayValue after the click event. I also have a json object with {'rating':'#'} but I cannot figure out how to have ExtJS correlate this value with the Rater's displayValue property. It seems that I set it after the component is already rendered, because I am setting under loadform success.

  rater = new Ext.ux.form.Rater({
        id: rater,
        fieldLabel: 'Contact Rating',
        displayValue:1,
        maxValue:10,
        rate:function(){                                         
           Ext.Ajax.request({
              url: '/pt-app/contacts/updateRating/',
              params:
              {
               contactID:6,
               rateValue: rater.hoverValue
              },
              method: 'POST',
              success: function(result) {
                 rater.displayValue = rater.hoverValue;
              }
          });
       }
  });

   formload:
         success:
              var objResponse = Ext.util.JSON.decode(myResponse.response.responseText);
              rater.displayValue = objResponse.data.rating;

I aspire to get the json value in there prior to the success of the form load (the bottom bit works, just too late), as well as have the component update when it is utilized. thanks much in advance. I feel like I just need to make a method call to the parent container to remove and add (reload?) it, but I can't determine what it is.

~brandon

A: 
rater.displayValue() 
Orbit