简体   繁体   English

保存/更新记录后,ExtJs行编辑网格组合筛选器不起作用

[英]ExtJs rowediting grid combo filter not work after save/update record

I have rowediting grid that gird have two combos and two text field. 我有行编辑网格,网格有两个组合和两个文本字段。

when type some character on combo box that combo box filter that type word from drop down list select that filter value and form combo and do save record ok and gird view record correctly NEXT--- after that select one of the gird record and start edit that record.type some character on combo box but that combo don't filter that type word form drop down list. 当在组合框上键入某个字符时,该组合框过滤器将从下拉列表中键入单词,选择该过滤器值并形成组合,并正确保存记录ok和gird视图记录NEXT ---之后,选择gird记录之一并开始编辑该record.type组合框上的某些字符,但该组合不会过滤键入单词形式的下拉列表。

note: that happen clearFilter(true); 注意:发生clearFilter(true); after save/update record. 保存/更新记录后。 If i remove clearFilter(true); 如果我删除clearFilter(true); gird view combo filtered result only that why I clear filter data before load store 网格视图组合筛选结果仅是为什么我在加载存储之前清除筛选器数据

This is my combo box grid column 这是我的组合框网格列

{
    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'
    }
},

This gird RowRditing 这个网格RowRditing

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

onRowEditingEdit function 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);


        }
    }

});  

I feel i did some basic mistake please help to me 我觉得我犯了一些基本错误,请帮助我

Same story here, bro. 同一个故事,兄弟。

I actively use ExtJS 4 and RowEditing since 2011, it always worked, until today when I found this bug. 自2011年以来,我一直积极使用ExtJS 4和RowEditing,它一直有效,直到今天发现此错误为止。 I could not even Google it until I debugged and found out a workaround with clearFilter(): 在调试并使用clearFilter()找到解决方法之前,我什至无法使用Google:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM