【问题标题】:ExtJS grid callback on load and reload加载和重新加载时的 ExtJS 网格回调
【发布时间】:2010-11-30 22:13:01
【问题描述】:

我有一个 Ext Grid,想要获取 JSON "success":false/true 响应并为每种情况执行一个函数。我希望将它作为与 JSON PHP 文件的每个网格交互的回调函数。

有这方面的例子吗?

感谢您的宝贵时间。

【问题讨论】:

    标签: php json extjs callback


    【解决方案1】:

    您需要注册JsonStore 的loadexception 事件的回调。像这样的:

     var grid = new Ext.grid.GridPanel({
         store: new Ext.data.JsonStore({
              [...]
              listeners: {
                   load: this.onLoadSuccess.crateDelegate(this),
                   exception: this.onLoadException.createDelegate(this)
              }
         }),
    
         onLoadSuccess: function () {
              // success
         },
    
         onLoadException: function () {
             // error
         },
    
         [...]
     }
    

    【讨论】:

      猜你喜欢
      • 2012-11-16
      • 2015-09-16
      • 2014-10-11
      • 2012-03-02
      • 1970-01-01
      • 2011-07-02
      • 2016-08-11
      • 1970-01-01
      • 2016-06-21
      相关资源
      最近更新 更多