Announcement

Collapse
No announcement yet.

this.recordView._parentView works in console but not in code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • this.recordView._parentView works in console but not in code

    Is there any way in the client framework for getting the parent model without fetching again if the current view is created by a view that has the wanted model ?
    for example when creating a meeting from a lead I would not want to fetch the lead model again to read its address but refer to the existing object
    the problem here is the only way i found of achieving this is to do like this:
    HTML Code:
    this.recordView._parentView._parentView._parentView.model // works in console but not in code
    but it probably is async code so I am looking for an easier way

    my current code that fails in setup function of dynamic handler:

    Code:
    [COLOR=#000000]stackParent = this.recordView._parentView._parentView._parentView.model;
    canAvoidFetch = stackParent && (stackParent.id === this.model.get('parentId') && (stackParent.get('parentType')) === this.model.get('parentType'));[/COLOR]

    Maybe it's populated after render event so I will need to listen for that and try again to get the model... any insight ?
    Last edited by tothewine; 09-21-2020, 11:45 PM.
Working...
X