2013-08-29 31 views
1

我有一個組合框的MVC面板,我將在他的存儲區(本地或遠程)完成加載後從組合框中刪除一些元素。Extjs 4.1加載後刪除組件中的元素

{ 
      xtype:'combo', 
      name: 'type', 
      editable: false, 
      //a local simple store with two field: 'valueType' and 'text' 
      store : Ext.create('AM.store.custompropview.propertyType'), 
      valueField : 'valueType', 
      fieldLabel: 'combo' 
} 

我已經在控制器試圖控制事件「AfterRender階段」或「boxready」和在功能以除去一些元件:

組合在該面板的視圖如下聲明從商店,但它根本不工作。

'combo[name="type"]' : { 
      boxready:function(th, width, height, eOpts){ 

       th.store.removeAt(0); 
       th.store.removeAt(0); 
       th.store.removeAt(0); 

       } 

我該怎麼辦呢?

謝謝

回答

2

我覺得店裏加載後您的組合呈現不只是後,所以你可以在控制器的初始化功能代碼,你應該刪除您的項目:

Ext.getStore('AM.store.custompropview.propertyType').on('load', function(store){ 
store.removeAt(0); 
}); 
+1

謝謝它的工作! – user