1

コンボボックスがあり、特定の値 (空/デフォルトではない) をロードすると、空白になります。

nameとの性質valueFieldが違うからだと思います。作成/更新は機能し、値はコンボにあります。手伝ってくれますか?

{
  xtype: 'combobox',
  anchor: '100%',
  fieldLabel: 'Organisme',
  name: 'idOrganismePriseEnCharge',
  displayField: 'Organisme',
  store: 'Organismes',
  valueField: 'idOrganisme'
}

私のモデル:

Ext.define('MG.model.TypeAide', {
    extend: 'Ext.data.Model',

    idProperty: 'idTypeAide',

    fields: [
        {
            name: 'idTypeAide'
        },
        {
            name: 'TypeAide'
        },
        {
            name: 'Montant'
        },
        {
            name: 'idOrganismePriseEnCharge'
        },
        {
            name: 'Organisme'
        }
    ]
});

私の店:

Ext.define('MG.store.TypesAides', {
    extend: 'Ext.data.Store',

    requires: [
        'MG.model.TypeAide'
    ],

    constructor: function(cfg) {
        var me = this;
        cfg = cfg || {};
        me.callParent([Ext.apply({
            autoLoad: true,
            model: 'MG.model.TypeAide',
            storeId: 'StoreTypesAides',
            proxy: {
                type: 'ajax',
                api: {
                    create: 'http://localhost/MG/php/TypesAides.php?action=create',
                    read: 'http://localhost/MG/php/TypesAides.php?action=read',
                    update: 'http://localhost/MG/php/TypesAides.php?action=update',
                    destroy: 'http://localhost/MG/php/TypesAides.php?action=destroy'
                },
                reader: {
                    type: 'json',
                    root: 'data'
                },
                writer: {
                    type: 'json',
                    root: 'data'
                }
            }
        }, cfg)]);
    }
});
4

1 に答える 1

0

valueField使用しているモデルのフィールドと一致する必要があります。あなたの場合idOrganisme、モデルにはそのようなフィールドはありません。

于 2013-06-07T06:16:20.310 に答える