2016-04-15 4 views
0

4.2.2で素晴らしい作業をしていましたが、バージョン5.1へのアップグレードを中止しました(互換モードはオフになっています)ナイトメア4.2.2から5.1へのアップグレード(アソシエイトは機能していません!!)

4.2.2で
Ext.define('BA.model.Betas', { 
    extend : 'Ext.data.Model', 
    fields : [ { 
     name : 'id', 
     type : 'number', 
     useNull : true 
    }, { 
     name : 'betaName', 
     type : 'string' 
    }, 
    .... 
    ], 
    belongsTo : [ { 
     name : 'model', 
     model : 'BA.model.Models', 
     associationKey : 'betas', 
     getterName : 'getModel', 
     setterName : 'setModel' 
    } ], 
    hasMany : [ { 
     name : 'securities', 
     model : 'BA.model.Securities', 
     primaryKey : 'id', 
     foreignKey : 'fk' 
    }, { 
     name : 'mappingVOs', 
     model : 'BA.model.Portfolios', 
     primaryKey : 'relId', 
     foreignKey : 'fk' 
    }, { 
     name : 'params', 
     model : 'BA.model.Params', 
     primaryKey : 'name' + 'group', 
     foreignKey : 'fk' 
    } ], 
    idProperty : 'id' 
}); 

私は(store.syncをしていた)、ツリー構造全体がサーバーに行っていた。

[ 
    { 
    "id": 199034, 
    "betaName": "DUVACFEF", 
    "betaDesc": "DUVACFEF", 
    "region": "GLOBAL", 
    "sequencer": "", 
    "securities": [data], 
    "mappingVOs": [data], 
    "params": [data] 
    } 
] 

しかし、ExtJSに5.1にアップグレードした後、これが起こっている:

[ 
    { 
    "id": 199034, 
    "betaName": "DUVACFEF", 
    "betaDesc": "DUVACFEF", 
    "region": "GLOBAL", 
    "sequencer": "", 

"FK":ヌル

} 
] 

助けてください。これを解決するにはどうすればよいですか?

答えて

0
Ext.data.writer.Json.override({ 
    /* 
    * This function overrides the default implementation of json writer. Any 
    * hasMany relationships will be submitted as nested objects. When preparing 
    * the data, only children which have been newly created, modified or marked 
    * for deletion will be added. To do this, a depth first bottom -> up 
    * recursive technique was used. 
    */ 
    getRecordData : function(record) { 
     return record.getData({ 
      associated : true 
     }); 
    } 
}); 
関連する問題