0

I am working with ExtJS MVC and implementing Scheduler.

I want to load my Store in my combo box but it was not load successfully.

My Store is

Ext.define('gantt.store.serviceStore', {
    extend: 'Ext.data.Store',
    model: 'gantt.model.Service',
    storeId: 'serviceStore',
    autoLoad: true,
    autoSync: true,
    proxy: {
        type: 'ajax',
        api: {
            read: 'Event/Get'
        },
        reader: {
            type: 'json',
            root: 'data'
        },
        writer: {
            type: 'json',
            encode: true,
            writeAllFields: true,
            root: 'data'
        }
    }
});

My Model is

Ext.define('gantt.model.Service', {
    extend: 'Sch.model.Event',
    fields: [{ name: 'ServiceId' },
        { name: 'ServiceName' },
        { name: 'Description' },
        { name: 'Rate' }
        ],
    proxy: {
        type: 'ajax',
        api: {
            read: 'Service/Get'
        },
        reader: {
            type: 'json',
            root: 'data'
        },
        writer: {
            root: 'data',
            type: 'json',
            encode: true,
            writeAllFields: true
        }
    }
});

and My ComboBox Code is below..

this.combo = new Ext.form.ComboBox({
   id: 'statesCombo',
   store: 'serviceStore',
   displayField: 'ServiceName',
   valueField: 'ServiceName',
   hiddenName: 'ServiceId',
   typeAhead: true,
   mode: 'local',
   fieldLabel: 'Services',
   anchor: '100%',
   forceSelection: true,
   triggerAction: 'all',
   emptyText: 'Select a Service',
   selectOnFocus: true   })

My Problem is when I am Click on combo box my value is not loaded.. and didnt display any Error.

4

1 回答 1

1

您缺少“名称”选项...像这样:

名称:'服务名称',

于 2012-03-28T15:12:28.813 回答