# Parent and events for list in object

**URL:** <https://forums.bitovi.com/t/parent-and-events-for-list-in-object/642>\
**Category:** CanJS\
**Created:** [May 16, 2017, 6:22am UTC](https://forums.bitovi.com/t/parent-and-events-for-list-in-object/642 "2017-05-16T06:22:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nada](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@nada](https://forums.bitovi.com/u/nada)\
**Post date:** [May 16, 2017, 6:22am UTC](https://forums.bitovi.com/t/parent-and-events-for-list-in-object/642/1 "2017-05-16T06:22:01Z")

</div>

Hi all,

I created a short JSBIN to ouline my problem [http://jsbin.com/bomulexaho/1/edit?html,js,console,output](http://jsbin.com/bomulexaho/1/edit?html,js,console,output)

What I want to accomplish:

- For each list entry have a link to the parent object
- Take some action when the add event for the list is triggered

I tried to use the init of the parent object for this, but the script fails as soon as it runs the lines  
this.AS.parent=this;  
this.AS.on(“add”, function() {console.log(“Event add”);})

Any suggestions how to resolv this?

---

<div class="post-metadata">

**Author:** ![fp\_dev](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@fp\_dev](https://forums.bitovi.com/u/fp_dev)\
**Post date:** [May 30, 2017, 6:58am UTC](https://forums.bitovi.com/t/parent-and-events-for-list-in-object/642/2 "2017-05-30T06:58:51Z")

</div>

I’m not sure that I understand your point but, you need something like this?

[example](http://jsbin.com/dupexedaxa/1/edit?html,js,console,output)

For the first point, what is for you the “parent” entry?

---

<div class="post-metadata">

**Author:** ![nada](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@nada](https://forums.bitovi.com/u/nada)\
**Post date:** [June 17, 2017, 9:07am UTC](https://forums.bitovi.com/t/parent-and-events-for-list-in-object/642/3 "2017-06-17T09:07:07Z")

</div>

Thx for making the code work. Helped me to get some more insight.

The parent link is not needed anymore. I realized that each view model assigned to a component gets initiated when rendered. That I somehow missed and wanted to work around with parent links.
