ExtJS Grid column with dataIndex from referenced model -
i have extjs gridanel
viewmodel store
bound it. model of store defined model field references model.
for sake of simplicity here's example:
ext.define('user', { extend: 'ext.data.model', fields: ['name'] }); ext.define('order', { extend: 'ext.data.model', fields: ['date', { name: 'user', reference: 'user' }] }); viewmodel: { store: { order: { model: 'order', } } }
in gridpanel
have 2 columns. in 1 column, dataindex: 'date'
works correctly, displaying date. however, in second column want display name of user. have no idea how that. user field
on object declaring dataindex: user
doesn't work. tried dataindex: {user.name}
doesn't work either. tried
bind: { data: '{user.name}' }
also no avail. have found solution using renderer
config of column ugly , beats point of having model reference if have manually traverse data structure appropriate field.
tl;dr i'm looking way declare column's dataindex
field reference
model.
Comments
Post a Comment