私は次のようなxtype:'combo'を持っています:
xtype: 'combo',
id: 'records_list_author_id',
emptyText: 'Filter By author',
editable: false,
store: 'FilterRecordsByAuthor',
displayField: 'firstname',
valueField: 'id',
lastQuery: '',
triggerAction: 'all',
queryMode: 'local',//'remote',
typeAhead: false,
width: 200
私は次のように定義されたプロキシを使用した非常に単純なストーリーを使用します。
proxy: {
type: 'ajax',
actionMethods: 'POST',
api: {
read: g_settings.baseUrl + 'index.php/record/getAuthorsOfRecords'
},
reader: {
type: 'json',
root: 'data',
idProperty: 'id',
successProperty: 'success'
//totalProperty: 'totalCount'
}
}
そして私のコントローラーにはこれがあります:
var comboBoxFilterByAuthorSt = this.getFilterRecordsByAuthorStore();
comboBoxFilterByAuthorSt.clearFilter(true);
comboBoxFilterByAuthorSt.filter ({
filterFn: function(item) {
return item.get('category_id') == sel.raw.categoryId;
}
})
たとえばsel.raw.categoryId = 1
、ストア内の2人の異なる著者のレコードと一致する場合、コンボボックスでは1つの名前しか取得できません。他の場合にも、私は間違った結果を受け取ります。SQLクエリを確認したところ、正常に機能し、正しい情報が返されましたが、ストアをフィルタリングすると、一致するものが得られず、それらが存在することがわかりました。問題はどこかにあるかもしれませんが、フィルターを作成するときに何かが足りないかもしれません。だから-どんなアドバイスも大歓迎です。
ありがとう
レロン