# Jslink end of player to number of tabs

**URL:** <https://discourse.holoviz.org/t/jslink-end-of-player-to-number-of-tabs/1574>\
**Category:** Panel\
**Tags:** panel\
**Created:** [December 15, 2020, 7:30pm UTC](https://discourse.holoviz.org/t/jslink-end-of-player-to-number-of-tabs/1574 "2020-12-15T19:30:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahuang11](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ahuang11/32/4947_2.png) [@ahuang11](https://discourse.holoviz.org/u/ahuang11)\
**Post date:** [December 15, 2020, 7:30pm UTC](https://discourse.holoviz.org/t/jslink-end-of-player-to-number-of-tabs/1574/1 "2020-12-15T19:30:17Z")

</div>

```auto
tabs = pn.Tabs('a', 'b')
player = pn.widgets.Player(end=len(tabs) - 1)
player.jslink(tabs, value='active', bidirectional=True)
pn.Column(tabs, player)

```

I was able to successfully link the value to active, but now if I append to tabs, I want the player end to match it too.

I think it’s something like:  
`player.jslink(tabs, code={'end': 'target.end = length(source)'})`  
but I don’t think it’s working.

---

<div class="post-metadata">

**Author:** ![ahuang11](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ahuang11/32/4947_2.png) [@ahuang11](https://discourse.holoviz.org/u/ahuang11)\
**Post date:** [December 15, 2020, 7:38pm UTC](https://discourse.holoviz.org/t/jslink-end-of-player-to-number-of-tabs/1574/2 "2020-12-15T19:38:10Z")

</div>

This works, but it watches active, not number of `tabs`

```auto
tabs = pn.Tabs('a', 'b')
player = pn.widgets.Player(end=len(tabs) - 1)
player.jslink(tabs, value='active', bidirectional=True)
tabs.jslink(player, code={'active': 'target.end = source.tabs.length - 1'})
tabs.append('a')
pn.Column(tabs, player)

```
