リモート ストアを使用してアプリにコンボボックスを追加したいと考えています。データをjson形式で返すphpスクリプトを呼び出すストアがあり、それをコンボボックスにリンクしました。ストアは autoLoaded ですが、コンボボックスはまだ空です。ここが私の店です
// Define autocomplete model
Ext.define('modelloAC', {
extend: 'Ext.data.Model',
fields: [
{ name: 'telaio' }
]
});
// store auto complete
var autoCompleteStore = Ext.create('Ext.data.Store', {
model: modelloAC,
autoLoad: true,
proxy: {
type: 'ajax',
url: 'script/request.php?operazione=gettelai',
reader: {
type: 'json',
root: 'telai',
totalProperty: 'results'
}
}
});
私のPHPはJSON配列を返します:
{"results":207,"telai":[{"telaio":"ZAR93200001271042"},{"telaio":"ZLA84000001738127"},{"telaio":"VF3WC9HXC33751301"},{"telaio":"W0L0AHL3555247737"}]}
私のコンボボックス:
xtype: 'combo',
name: 'telaio',
//hideTrigger: true,
store: autoCompleteStore,
typeAhead: true,
queryMode: 'remote',
fieldLabel: 'Telaio'
ストアは完全にロードされますが、コンボボックスが空です。どこに問題がありますか?