为JsonStore设置timeout

因为数据量较大,后台响应会比较慢,JsonStore调用load方法之后可能出现超时的情况,解决的办法很简单。
把创建JsonStore时的代码:
myStore = new Ext.data.JsonStore({
  url: "http://www.example.com/test.php",
  ...
});

改为:
var myBigTimeout = 90000; // 90 sec
myStore =  new Ext.data.JsonStore({
  proxy: new Ext.data.HttpProxy({ 
              url: "http://www.example.com/test.php",
              timeout: myBigTimeout 
         }),
//url: "http://www.example.com/test.php",
  ...
});

VIA


Last modified on 2009-10-27