I need to bind child view to viewmodel of parent view. my structure is -
parentView{
items : [{
xtype : 'childview'
}]
}
parentViewModel{data : NAME}
childview : {
items : {[
xtype : 'label',
bind : {value : '{NAME}'}
]}
}
Actually, you don't need to use the
viewModel
for the children at all. All the child views in the component chain do have a natural access to the parentviewModel
.See the ExtJS guide for further explanation. (I sincerely recommend reading all of it :) ).
Hope this helps a little!