0

我有行编辑网格,网格有两个组合和两个文本字段。

当在组合框上键入某个字符时,该组合框从下拉列表中过滤该类型的单词时,选择该过滤器值并形成组合,并正确保存记录并正确查看记录 NEXT --- 之后选择一个网格记录并开始编辑该记录。在组合框中键入一些字符,但该组合不会过滤该类型的单词表单下拉列表。

注意:这发生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);


        }
    }

});  

我觉得我犯了一些基本错误请帮助我

4

1 回答 1

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);
        }
    });
});
于 2017-10-06T15:08:20.373 回答