Mapping List within ArrayList - Ext js 4 model

192 Views Asked by At

I need to map my List that's with in list but couldn't do it . I tried using hasmany but it wont help . Unless its mapping i'm unable to loop my tpl as its not detecting the proper objects. Below is my Json:

    {  
   "containers":[  
      {  
         "count":654,
         "week":47
      },
      {  
         "count":779,
         "week":48
      }
   ],
   "vessels":[  
      {  
         "count":44,
         "week":47
      },
      {  
         "count":39,
         "week":48
      }
   ]
}

My model :

Ext.define('ContainerChartStore', {
    extend : 'Ext.data.Model',
    fields : [{
        name : "containers",
        type : Ext.data.Types.List
    },{
        name : "vessels",
        type : Ext.data.Types.List
    }],
    hasMany: {
        model: 'InboundObjects',
        name: 'inboundObjects'
    }
});

Ext.define('InboundObjects', {
    extend: 'Ext.data.Model',
    config: {
        fields : [{
            name : "count",
            type : Ext.data.Types.NUMBERARRAY
        },{
            name : "week",
            type : Ext.data.Types.NUMBERARRAY
        }]
    }
});
0

There are 0 best solutions below