【发布时间】:2015-05-22 05:23:16
【问题描述】:
我有行编辑网格,网格有两个组合和两个文本字段。
当在组合框上键入一些字符时,组合框会从下拉列表中过滤该类型的单词 选择该过滤器值并形成组合并正确保存记录和网格视图记录 下一个 - - 之后选择一个网格记录并开始编辑该记录。在组合框中键入一些字符,但该组合不会过滤该类型的单词表单下拉列表。
注意:在保存/更新记录后发生clearFilter(true);。如果我删除clearFilter(true); gird view 组合过滤结果,那么我为什么在加载存储之前清除过滤器数据
这是我的组合框网格列
{
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);
}
}
});
我觉得我犯了一些基本错误,请帮助我
【问题讨论】:
-
为什么还要在 onRowEditingEdit 函数中干预组合框存储?默认情况下,ExtJs 会自动处理这些存储及其过滤器。
-
@LorenzMeyer 当我在网格保存后不清除组合存储时。网格仅查看上次过滤结果,这就是我清除过滤器的原因
-
我不能告诉你有什么不同,但我只删除了网格上的过滤器。组合由 ExtJs 正确管理。
标签: extjs combobox grid extjs4 roweditor