我有使用远程存储和远程分页,因为我有主电网太多records.The店一格是:ExtJS的4基于一个组合框选择呈现新的网格
Ext.define('ArD.store.RecordsListStore', {
extend: 'Ext.data.Store',
model: 'ArD.model.RecordsListModel',
autoLoad: true,
autoSync: true,
remoteSort: true,
remoteFilter: true,
pageSize: 15,
proxy: {
type: 'ajax',
actionMethods: 'POST',
api: {
read: g_settings.baseUrl + 'index.php/recordslist/getAll',
destroy: g_settings.baseUrl + 'index.php/recordslist/deleteRecord'
},
reader: {
type: 'json',
root: 'data',
totalProperty: 'totalCount',
successProperty: 'success'
},
writer: {
root: 'data',
writeAllFields: true,
encode: true
}
}
});
然后我填充我的网格和它都很好。但问题是,我有一个组合框,看起来像这样:
{
xtype: 'combo',
id: 'records_list_form_id',
emptyText: 'Choose Form',
editable: false,
store: 'FilterRecordsByForm',
displayField: 'title',
valueField: 'id',
lastQuery: '',
triggerAction: 'all',
queryMode: 'remote',
typeAhead: false,
width: 200,
listeners: {
select: this._filterRecords
}
}
当我从下拉框中选择一些有功能:
_filterRecords: function()
{
var recStore = Ext.getStore('RecordsListStore');
var a = Ext.getCmp('records_list_form_id').getValue();
var rec = Ext.getStore('FilterRecordsByForm').getAt(a);
console.log(recStore);
},
大多只是尝试一些东西,但我可以得到从组合框中选择元素的ID,这就是我所在的位置。
我需要的是让id作为一个新的查询使用我的AJAX api(PHP/SQL后端)并使用与此id相关的信息填充网格。在我的情况下,我有1:M的关系,所以当我通过Id时,我希望在旧网格的位置上呈现M个记录。
感谢
Leron