This is a migrated thread and some comments may be shown as answers.

Shared Layout Contains NavBar. Can I update NavBar title using MVVM inside the View that uses Layout?

1 Answer 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 21 Sep 2012, 05:15 PM
I'm attempting set the NavBar title in a shared Layout dynamically using MVVM.  I would like to do this within each View that implements that Layout.  I know that I can use the data-title attribute on the View to set the NavBar's title at runtime; however, the reason I would like to be able to set it dynamically is so that the NavBar title can represent the application state that will change with each ajax call done within the separate views.  Since the ajax calls will update the view-model, it would be convenient to have these change propagated to the NavBar's title automatically.  Short of eliminating the layout and putting a separate NavBar within each View, is there a way for the View to update the Layout's NavBar on the fly?

1 Answer, 1 is accepted

Sort by
0
Norbert
Top achievements
Rank 1
answered on 23 Dec 2012, 10:33 AM
Try to bind the navbar or header containing the navbar to the viewmodel.
kendo.bind($("#idofheadertag"), viewmodel);
It is also possible to bind whole layout to the viewmodel.
Tags
General Discussions
Asked by
Daniel
Top achievements
Rank 1
Answers by
Norbert
Top achievements
Rank 1
Share this question
or