I have a component with a tpl and I want to bind its data to my ViewModel. I tried this and it doesn't appear to work. Am I missing something or is this not possible with components? My dataviews on the page page are working just fine with the bindings so I know the data is there.
Code:
xtype: 'component',
cls: 'w-job-info',
tpl: [
'<div class="w-row">',
'<div class="w-left">',
'<span class="w-label">Job Ref</span>',
'<span class="w-value">{jobRef}</span>',
'</div>',
'<div class="w-left">',
'<span class="w-label">Process Ref</span>',
'<span class="w-value">{procRef}</span>',
'</div>',
'<div class="w-right">',
'<span class="w-label">Job State</span>',
'<span class="w-value">{jobState}</span>',
'</div>',
'</div>'
],
bind: {
data: {
jobRef: '{record.prociRef}',
procRef: '{record.procRef}',
// jobState: Wp.base.util.DisplayState.getDisplayJobState(record.get('state'))
jobState: '{state}'
}
}