2015-03-19 43 views
0

我有rowediting網格,網格有兩個組合和兩個文本字段。ExtJs rowediting網格組合過濾器保存/更新記錄後不工作

當類型的組合框一些字符組合框過濾從下拉列表 該類型字選擇篩選值和形式組合,並做保存記錄確定正確 NEXT --- 後選擇一個佩帶瀏覽記錄並開始編輯record.type組合框上的某個字符,但該組合框不會過濾該類型的單詞表單下拉列表。

注意:保存/更新記錄後發生clearFilter(true);。如果我刪除clearFilter(true);網格視圖組合篩選的結果只是爲什麼負載存儲之前,我清晰過濾器數據

這是我的組合框格列

{ 
    xtype: 'gridcolumn', 
    itemId: 'colId', 
    width: 140, 
    dataIndex: 'ID', 
    menuDisabled: true, 
    text: 'Name', 
    editor: { 
     xtype: 'combobox', 
     id: 'cbold', 
     itemId: 'cbold', 
     name: 'CBO_ID', 
     allowBlank: false, 
     displayField: 'NAME', 
     queryMode: 'local', 
     store: 'Store', 
     valueField: 'FIELD_ID' 
    } 
}, 

這束腰RowRditing

  plugins: [ 
       Ext.create('Ext.grid.plugin.RowEditing', { 
        saveBtnText: 'Save', 
        pluginId: 'grdEditor', 
        autoCancel: false, 
        clicksToMoveEditor: 1, 
        listeners: { 
         edit: { 
          fn: me.onRowEditingEdit, 
          scope: me 
         } 
        } 
       }) 
      ], 

onRowEditingEdit功能

Ext.Ajax.request({ 
    url: 'url', 
    method: 'POST', 
    scope:this, 
    success : function(options, eOpts) { 
     var store  = Ext.getStore('GridStore'); 
     var grid = Ext.getCmp('gridFileLyt'); 

     cbo1Store = Ext.getStore('cbo1Store'); 
     cbo1Store.clearFilter(true); 
     cbo1Store.load(); 

     cbo2Store = Ext.getStore(cbo2Store); 
     cbo2Store..clearFilter(true); 
     fldStore.proxy.extraParams = { 
      '_ID': '' 
     }; 
     cbo2Store.load(); 

     if(response.success){ 
      Ext.Msg.alert('Success', response.msg); 

     } else { 

      Ext.Msg.alert('Failed', response.msg); 


     } 
    } 

}); 

我覺得我做了一些基本的錯誤,請幫助對我來說

+0

爲什麼你甚至在你的組合框店插手onRowEditingEdit功能?默認情況下,ExtJs會自動處理這些商店及其過濾器。 – 2015-03-21 08:17:15

+0

@LorenzMeyer當我沒有清除網格保存後的組合商店。網格僅查看上次篩選結果只有爲什麼我清除篩選器 – user881703 2015-03-23 02:29:47

+0

我不能告訴你什麼是不同的,但我只在網格上刪除篩選器。組合由ExtJs正確管理。 – 2015-03-23 12:19:06

回答

1

同樣的故事在這裏,兄弟。

自2011年以來,我積極使用ExtJS 4和RowEditing,它一直在運行,直到今天我發現了這個錯誤。 我不能連谷歌它,直到我調試,發現一個解決方法與clearFilter():

rowEditingPlugin.on('beforeedit', function(editor, e) { 
    editor.editor.form.getFields().each(function(field){ 
     if (field instanceof Ext.form.field.ComboBox) { 
      field.store.clearFilter(true); 
     } 
    }); 
});