Results 1 to 2 of 2

Thread: Child view model access when using formula

  1. #1
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    142
    Answers
    9
    Vote Rating
    12
      0  

    Default Child view model access when using formula

    Hi,

    I'm using viewmodels, and have a child control which inherits a viewmodel
    I needed to add a

    viewModel:{} ,

    to my child control to get access to the parent.

    I can use

    me.getViewModel().get('blah')

    and thats working fine if 'blah' is in the data section.


    I have some forumla in the viewModel :

    data : {
    UID:123
    },
    formulas: {
    currentUserId: function (get) // Alias for UID
    {
    return get('UID');
    }
    }


    Now - In the child - I have access to vm.get("UID") - but vm.get("currentUserId") is returning null.

    Am I missing something ?
    Is this expected behaviour ?
    Should I be able to get the formula from child views ?

  2. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446
    Vote Rating
    186
      0  

    Default

    Hi--

    Can you create a Fiddle demonstrating the issue?

    Thanks
    Joel

Posting Permissions

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