【发布时间】:2015-01-06 19:38:52
【问题描述】:
在单独的函数中使用 bindStore 将商店绑定到组合框。
一切正常 - 除了我需要根据给定参数过滤该函数中的数据。
loadMarkers: function(store, value){
store.filter('markerid',17);
this.fields.marker.bindStore(store);
this.fields.marker.setValue(value);
}
这个具体的例子有两种不同的方式我试过了——绑定之前和之后。最后的 Console.log 显示了“存储”甚至组合框的过滤存储。但是组合框本身仍然显示所有内容。
组合框配置:
marker: new Ext.form.ComboBox({
fieldLabel: _('Marker'),
displayField: 'name',
valueField: 'id',
mode:'local',
lastQuery: '',
store: new Ext.data.JsonStore({
fields: ['name', 'id', 'markerid'],
data: [
{name:_('Default'), id: 0, markerid: 0}
]
})
})
this.markerStore = new Ext.data.JsonStore({
autoLoad: true,
url: 'Api/getMarkers',
root: 'response',
sortInfo: {field: 'name', direction: 'ASC'},
fields: Ext.data.Record.create([
{name: 'id', type: 'integer'},
{name: 'name', type: 'string'},
{name: 'markerid', type: 'integer'}
])
});
【问题讨论】:
-
你也可以显示你的商店配置
-
已更新商店配置
-
你使用的是什么版本的 Ext?我会在几分钟内发布一些代码
-
ext 3.4(标签中的ext3)
标签: javascript extjs ext3