Extjs Model Fields with Subfields

extjs, field, grid, model

Solution

Thanks to @sha - here is the answer I needed :)

Model

fields:[

            {name: 'id', type: 'int'},
            {name: 'title', type: 'string'},
            {name: 'description', type: 'string'},
            {name: 'priority', type: 'auto'},
            {name: 'code', type: 'string', mapping:'priority.code'},
            {name: 'createdBy', type: 'auto'},

        ]

Gird Panel

columns:[

             {header:'Title', dataIndex:'title', flex:1},
             {header:'Description', dataIndex:'description'},
             {header:'Priority', dataIndex:'code'}

         ],

Problem

Anyone know how you model subfields of any field in ExtJS? For example Ext.data.Model: ``` fields:[ {name: 'id', type: 'int'}, {name: 'title', type: 'string'}, {name: 'description', type: 'string'}, {name: 'priority', type: 'auto', fields:[ {name: 'code', type: 'string'} ]}, {name: 'createdBy', type: 'auto'}, ] ``` then in my grid panel Ext.grid.Panel ``` columns:[ {header:'Title', dataIndex:'title', flex:1}, {header:'Priority', dataIndex:'code'} ], ``` Any idea how I access the dataIndex 'code' under 'priority'? thanks in advance!

Original source