# Perspective Table - Expand Subview function

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-expand-subview-function/34457>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 5, 2020, 6:35pm UTC](https://forum.inductiveautomation.com/t/perspective-table-expand-subview-function/34457 "2020-05-05T18:35:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![danieltalbot](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/danieltalbot/32/11201_2.png) [@danieltalbot](https://forum.inductiveautomation.com/u/danieltalbot)\
**Post date:** [May 5, 2020, 6:35pm UTC](https://forum.inductiveautomation.com/t/perspective-table-expand-subview-function/34457/1 "2020-05-05T18:35:37Z")

</div>

I know there are onSubviewExpand and onSubviewCollapse events built into the Table component, but is there a function I could use in an onRowClick event script to expand and collapse a subview?

I am trying to make it so that clicking anywhere on a row will open the subview to that row.

Thank you.

---

<div class="post-metadata">

**Author:** ![janne.p](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@janne.p](https://forum.inductiveautomation.com/u/janne.p)\
**Post date:** [June 4, 2020, 11:50am UTC](https://forum.inductiveautomation.com/t/perspective-table-expand-subview-function/34457/2 "2020-06-04T11:50:56Z")

</div>

I am also trying to achieve same functionality. For most of the use cases it would be best to open subview by clicking the row no matter where to click

---

<div class="post-metadata">

**Author:** ![janne.p](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@janne.p](https://forum.inductiveautomation.com/u/janne.p)\
**Post date:** [January 7, 2021, 6:17am UTC](https://forum.inductiveautomation.com/t/perspective-table-expand-subview-function/34457/3 "2021-01-07T06:17:18Z")

</div>

Made a feature request about this issue:

[https://inductiveautomation.canny.io/ignition-features-and-ideas/p/perspective-table-expand-subview-function](https://inductiveautomation.canny.io/ignition-features-and-ideas/p/perspective-table-expand-subview-function)

Upvote it if you also would need this feature

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [August 9, 2023, 6:19pm UTC](https://forum.inductiveautomation.com/t/perspective-table-expand-subview-function/34457/4 "2023-08-09T18:19:23Z")

</div>

Do you have an image of the functionality in case I don't understand?  
I saw it is listed as planned I think.

Do you mean like the context menus that are new?  
[New Feature: Component Context Menu](https://forum.inductiveautomation.com/t/new-feature-component-context-menu/68763)]  
I don't have 8.1.25, haven't tried them myself.

I am passing parameters and navigating to a page when I click a row sometimes.  
I would benefit from faster ways to show table construction information.  
I would benefit from faster ways to show subset views based on row data.

I am not sure if the tools exist already and I don't know about some good capabilities already possible.

---

<div class="post-metadata">

**Author:** ![danieltalbot](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/danieltalbot/32/11201_2.png) [@danieltalbot](https://forum.inductiveautomation.com/u/danieltalbot)\
**Post date:** [October 24, 2023, 2:10am UTC](https://forum.inductiveautomation.com/t/perspective-table-expand-subview-function/34457/5 "2023-10-24T02:10:18Z")

</div>

The functionality I was after was being able to click anywhere in a table row and have that call a function to expand the row's subview... There is no way to do this programmatically, you just have to click on the arrow to open the row subview

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 24, 2023, 2:44am UTC](https://forum.inductiveautomation.com/t/perspective-table-expand-subview-function/34457/6 "2023-10-24T02:44:04Z")

</div>

I was able to place this as part of the `onRowClick` Event of the Table:

```auto
def runAction(self, event):
	self.expandSubviews([event.rowIndex])

```

it resulted in the Table expanding the subview for whichever row I clicked.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [October 24, 2023, 12:48pm UTC](https://forum.inductiveautomation.com/t/perspective-table-expand-subview-function/34457/7 "2023-10-24T12:48:24Z")

</div>

Can you show me an example of unexpanded and expanded?

I thought it would require an event script to hide/unhide something, and setting row information to a custom property.

Didn't know about the function. I will try to try it.

* * *

I am missing something. When I click on my rows, nothing happens.

* * *

I found an example. [Displaying a Subview in a Table Row - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Displaying+a+Subview+in+a+Table+Row)]

---

<div class="post-metadata">

**Author:** ![Cole\_Townsend](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cole_townsend/32/53149_2.png) [@Cole\_Townsend](https://forum.inductiveautomation.com/u/Cole_Townsend)\
**Post date:** [October 26, 2023, 5:44pm UTC](https://forum.inductiveautomation.com/t/perspective-table-expand-subview-function/34457/8 "2023-10-26T17:44:41Z")

</div>

I believe you should have used event.row instead of rowIndex here.

Your script will break if the table is filtered.
