weixin_33719619 2010-06-25 19:50 采纳率: 0%
浏览 63

在ajax后重新加载extjs对象

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

  • 写回答

1条回答 默认 最新

  • YaoRaoLov 2010-06-26 13:43
    关注
    rater.displayValue() 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配