Loading grid from nested json using 'hasMany' association (model)

149 Views Asked by At

I have a nested json as below and i want to load my grid from node: 'feedetails'. I want use association in model and load it via store which is accessible in my controller. Need help.

{
"feepanel": {
    "totalAnticipatedMarketValue": "2165951.00",
    "feeSetupCtg": {
        "feeDetails": [
            {
                "fromRange": 0,
                "toRange": 249999,
                "dollarFactor": 0,
                "standardRate": 2.5,
                "standardPrevRate": 0,
                "discountRate": 2.5,
                "valueFee": 0,
                "individualFee": 6250.07,
                "itemSupportRate": 1.2,
                "itemFloorRate": 0.9,
                "totalFee": 6249.98,
                "managerFee": 0,
                "itemClientRate": 2.97,
                "itemAeRate": 2.5,
                "itemRetenRate": 0.47
            },
            {
                "fromRange": 250000,
                "toRange": 499999,
                "dollarFactor": 0,
                "standardRate": 2.5,
                "standardPrevRate": 0,
                "discountRate": 2.5,
                "valueFee": 0,
                "individualFee": 6250.07,
                "itemSupportRate": 1,
                "itemFloorRate": 0.75,
                "totalFee": 6250,
                "managerFee": 0,
                "itemClientRate": 2.97,
                "itemAeRate": 2.5,
                "itemRetenRate": 0.47
            }
        ]
    }

}

}

Below is the model description n which I have the association, but this doesn't work.

{name: 'feeDetailsOld',mapping: 'feeSetupCtg_Old.feeDetails'},

associations : [                 
                {
                    type : 'hasMany',
                    model : 'MCT.model.FeeOldTieredModel',
                    name : 'feeDetailsOld',
                    associationKey : 'feeDetailsOld'
               }
              ]

Below is the code in controller

model.feeDetailsOldStore // this is coming undefined

0

There are 0 best solutions below