0

ExtJS MVC を使用し、スケジューラを実装しています。

ストアをコンボ ボックスにロードしたいのですが、正常にロードされませんでした。

私の店は

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

私のモデルは

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

私のComboBoxコードは以下の通りです..

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   })

私の問題は、コンボボックスをクリックすると値が読み込まれず、エラーが表示されないことです。

4

1 に答える 1

1

「名前」オプションがありません...次のように:

名前: 'サービス名',

于 2012-03-28T15:12:28.813 に答える