Results 1 to 3 of 3

Thread: ViewModel Inheritance with NavigationView

  1. #1
    Sencha Premium Member
    Join Date
    Jun 2010
    Posts
    36
    Answers
    3

    Default ViewModel Inheritance with NavigationView

    I have a question related to how ViewModel inheritance works when it comes to using NavigationViews. It's my understanding that if you have a View that has a viewmodel configured, and then you add a another view as a child of that view, the childview's viewmodel will inherit from the parent viewmodel, and you'll be able to access anything in the parent viewmodel. However, this doesn't appear to be the case with NavigationView's as the parent. I'd like to have a NavigationView with a viewmodel that can contain information that will persist across different child views being pushed/popped into/out of the NavigationView. I feel as though it's related to the fact that NavigationViews require you to dynamically add the child views at runtime, whereas in other cases I usually statically add child views ahead of time using the 'items' config of the parent.

    Has anyone else run into this, or am I likely just doing something wrong?

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha Premium Member
    Join Date
    Jun 2010
    Posts
    36
    Answers
    3

    Default

    Thanks for the reply Evan. I was able to get everything working correctly, so it must have been some simple error I was making in the config.

Similar Threads

  1. viewModel inheritance when involving popup window
    By SebTardif in forum Ext 5: Q&A
    Replies: 9
    Last Post: 7 Apr 2019, 4:46 PM
  2. [OPEN] Child viewModel saves undeclared bind attributes on root viewmodel
    By robboerman in forum Ext JS 6.x Bugs
    Replies: 3
    Last Post: 12 Sep 2017, 2:31 AM
  3. ViewModel inheritance
    By pruslan in forum Ext 5: Q&A
    Replies: 3
    Last Post: 16 Aug 2016, 4:34 AM
  4. VERY SIMPLE ViewModel inheritance
    By jksuf in forum Ext 5: Q&A
    Replies: 1
    Last Post: 17 Feb 2015, 2:11 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •