2013-07-01 12 views
0

我有一個見面的問題,該批次:店內的同步在ExtJS的

有我在FormPanel中3個店一頁。 store1,store2,store3。 現在我需要在一個功能中同步所有商店。 但是,如你所知,同步是同步的,所以我不知道哪個商店最後同步。 我需要知道,因爲我想在最後一次同步的回調中輸出一些成功信息。 我可以使用Ext.data.Batch來解決問題嗎?

回答

0

你需要與批處理同步,但我不知道如何實現。

在我的應用程序,我需要3個店前準備好來呈現我的網格,以便我做:

launch: function(){ 
     myMask = new Ext.LoadMask(document.body,{msg:"Cargando recursos..."}); 
     myMask.show(); 
     Ext.create('tsjdf.store.catalogo.secretarias').load({ 
      scope: this, 
      callback: this.onStoresReady 
     });Ext.create('tsjdf.store.catalogo.organos').load({ 
      scope: this, 
      callback: this.onStoresReady 
     });Ext.create('tsjdf.store.libro.ejemplo').load({ 
      scope: this, 
      callback: this.onStoresReady 
     }); 
    }, 
    onStoresReady: function(){ 
     if(1 
      & !Ext.StoreManager.get('catalogo.secretarias').isLoading() 
      & !Ext.StoreManager.get('catalogo.SiNo').isLoading() 
      & !Ext.StoreManager.get('catalogo.organos').isLoading() 
      & !Ext.StoreManager.get('libro.ejemplo').isLoading() 

     ){ 
     //al stores ready, I can continue 
     } 

我希望它幫你