autocomplete combobox mit extjs ajax remote speichern

Möchte ich hinzufügen, dass eine combobox in meine app mit einem remote-store. Ich habe ein Geschäft, dass call ein php-script liefert Daten im json-format und ich Verband es mit meiner combobox.
Der Speicher wird geladen, aber meine combobox ist immer noch leer.
Hier ist mein store

//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'
        }
    }
});

Mein PHP wieder eine JSON-array:

{"results":207,"telai":[{"telaio":"ZAR93200001271042"},{"telaio":"ZLA84000001738127"},{"telaio":"VF3WC9HXC33751301"},{"telaio":"W0L0AHL3555247737"}]}

Meine combobox:

    xtype: 'combo',
    name: 'telaio',
   //hideTrigger: true,
   store: autoCompleteStore,
   typeAhead: true,
   queryMode: 'remote',
   fieldLabel: 'Telaio'

Meinem Shop lädt perfekt, aber meine combobox ist leer, wo ist das problem?

Sie sollte hinzufügen, displayField: 'telaio", um Ihre combobox-config

InformationsquelleAutor andyts93 | 2013-04-30

Schreibe einen Kommentar