开发者

reload extjs object after ajax

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


rater.displayValue() 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜