2013-09-30 126 views
1

我有一個網格列的組合框編輯器。它也是可編輯的。組合框的商店具有autoLoad配置,設置爲false意味着當用戶單擊組合框時,商店被加載。如果我沒有在組合框中輸入任何內容並點擊它,它會正常工作。但是,如果我在組合框中首先鍵入某個內容,然後單擊外部,然後再次單擊組合框以加載下拉列表,它根本不顯示。它只顯示加載,然後不顯示下拉菜單。ExtJS combobox沒有渲染

這是一個非常奇怪的問題,因爲我對其他列也有類似的組合框,並且工作正常,但它們不可編輯。

這是否與可編輯配置有關?

var contextDropDownStoreforFactGrid = Ext.create('Ext.data.Store', { 
    fields: [{name:'context',type:'string'}], 
    proxy: { 
     type: 'ajax', 
     url: context + '/FcmServlet', 
     extraParams: { 
      'action': 'getContextDropDownValues' 
     }, 
     reader: { 
      type: 'json' 
     } 
    }, 
    autoLoad: false /* load the store only when combo box is selected */ 
}); 

    editor: { 
       xtype: 'combo', 
       store: contextDropDownStoreforFactGrid, 
       qureyMode: 'remote', 
       id: 'fact_contextId', 
       displayField:'context', 
       valueField: 'context', 
       vtype: 'alphanum', 
       listeners: { 
        beforeQuery: function(query) { 
         if (contextDropDownStoreforFactGrid.getCount() != 0) { 
          contextDropDownStoreforFactGrid.removeAll(); 
          contextDropDownStoreforFactGrid.load(); 
         } 

        } 
       } 
      }, 
       renderer: function(value) { 
       var index = contextDropDownStoreforFactGrid.find('context', value); 
       if (index != -1) { 
        return contextDropDownStoreforFactGrid.getAt(index).data.context;    
       } 
       return value; 
      } 
+0

提供您的代碼。 – kuldarim

+0

我已經添加了我的代碼,即使我刪除了渲染器,它仍然存在相同的問題。 –

回答

0

你有拼寫錯誤在你的組合框配置:

qureyMode: '遠程',

應該

queryMode: '遠程',

這可能會導致組合框無法從商店加載數據。

+0

不,我修正拼寫並再次嘗試,仍然是同一個問題 –