2013-01-19 40 views

回答

5
setInterval(function(){ 
    // Use Ext.getStore to reference your store from the controller 
    var myStore = Ext.getStore('YourStore'); 
    // Pass in an object of the changes you want to be made to the store 
    myStore.proxy.extraParams = { key:'sencha'}; // replace with your own object 
    myStore.load(); 

},3000); 
+3

extraParams是針對每個請求獲取子參數的參數。要爲特定的加載操作應用param,應該調用'load({params:{key:'sencha'}})''。每次更改extraParams都是一個糟糕的設計。 – sra

0

在Extjs FYI可以通過Ext.util.TaskRunner執行。 示例代碼:

var runner = new Ext.util.TaskRunner(), 
clock, updateClock, task; 

clock = Ext.getBody().appendChild({ 
    id: 'clock' 
}); 

// Start a simple clock task that updates a div once per second 
updateClock = function() { 
    clock.setHtml(Ext.Date.format(new Date(), 'g:i:s A')); 
}; 

task = runner.start({ 
    run: updateClock, 
    interval: 1000 
}); 
相關問題