2017-03-06 15 views
2

私は、エディタ機能で何かを選択するグリッドでcomboxを取得しようとしています。しかし、レンダリング値は毎回0です。保存後、正しく動作します。ExtJs Comboxが正しくレンダリングされない

Ext.define('Shopware.apps.Order.view.detail.BackPosition', { 
override: 'Shopware.apps.Order.view.detail.Position', 

initComponent: function() { 
    var me = this; 
    me.mdsupplierStore = Ext.create('Shopware.apps.Order.store.MDSupplier').load(); 
    me.callParent(arguments); 

}, 

getColumns: function(grid) { 
    var me   = this; 

    var col  = me.callOverridden(arguments); 
    var md_supplier = {}; 
    grid.mdsupplierStore = me.mdsupplierStore; 

    var MDSupplier= { 
     header: 'Lieferant', 
     dataIndex: 'md_supplier', 
     flex:2, 
     renderer: me.supplierColumn, 
     editor: { 
      xtype: 'combobox', 
      editable: false, 
      queryMode: 'local', 
      allowBlank: false, 
      store: grid.mdsupplierStore, 
      displayField: 'name', 
      valueField: 'id', 

     } 

    }; 


    col = Ext.Array.insert(col, 9, [MDSupplier]); 
    return col; 
}, 

supplierColumn: function(value, metaData, rowRecord) { 

    var me = this; 
    console.log(value); 
    //value is 0 when I click the editor combobox <--- 
}, 

});

モデル:

Ext.define('Shopware.apps.Order.model.MDSupplier', { 
    extend:'Shopware.data.Model', 

idProperty : 'id', 

fields:[ 

    { name : 'id', type: 'int'}, 
    { name : 'name', type: 'string'} 
] 

})。

ストア:

Ext.define('Shopware.apps.Order.store.MDSupplier',{ 
configure: function() { 
    return { controller: 'MDSupplier' }; 
}, 
/** 
* Define that this component is an extension of the Ext.data.Store 
*/ 
extend: 'Ext.data.Store', 

/** 
* Auto load the store after the component 
* is initialized 
* @boolean 
*/ 
autoLoad: false, 

/** 
* Define the used model for this store 
* @string 
*/ 
model: 'Shopware.apps.Order.model.MDSupplier', 

proxy : { 
    type : 'ajax', 
    url: '/backend/MDSupplier/load', 

    reader:{ 
     type: 'json', 
     root: 'data', 
     totalProperty: 'total' 
    } 
} 

});

誰かが私に間違っていると教えてもらえますか?

+0

値はストアから取得されているため、ストアにロードするデータを入力してください。 – Alexander

答えて

0

私はそれを得ました。データの処理が間違っていたため、フィールドは毎回NULLになっていました。

関連する問題