# \[Feature-1985\]Perspective table: Close sub view of table via script

**URL:** <https://forum.inductiveautomation.com/t/feature-1985-perspective-table-close-sub-view-of-table-via-script/37995>\
**Category:** Ignition\
**Tags:** perspective, ignition80\
**Created:** [August 22, 2020, 1:03pm UTC](https://forum.inductiveautomation.com/t/feature-1985-perspective-table-close-sub-view-of-table-via-script/37995 "2020-08-22T13:03:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yash.bhan](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yash.bhan](https://forum.inductiveautomation.com/u/yash.bhan)\
**Post date:** [August 22, 2020, 1:03pm UTC](https://forum.inductiveautomation.com/t/feature-1985-perspective-table-close-sub-view-of-table-via-script/37995/1 "2020-08-22T13:03:26Z")

</div>

Hi

Is there any way to close/collapse an open sub view in a table via script.

---

<div class="post-metadata">

**Author:** ![jasoncoope](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jasoncoope/32/18674_2.png) [@jasoncoope](https://forum.inductiveautomation.com/u/jasoncoope)\
**Post date:** [November 10, 2020, 12:21am UTC](https://forum.inductiveautomation.com/t/feature-1985-perspective-table-close-sub-view-of-table-via-script/37995/2 "2020-11-10T00:21:56Z")

</div>

I’m wondering about this too. Anyone figure out a way?

---

<div class="post-metadata">

**Author:** ![fleclerc](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/fleclerc/32/20480_2.png) [@fleclerc](https://forum.inductiveautomation.com/u/fleclerc)\
**Post date:** [March 4, 2021, 3:43pm UTC](https://forum.inductiveautomation.com/t/feature-1985-perspective-table-close-sub-view-of-table-via-script/37995/3 "2021-03-04T15:43:35Z")

</div>

I tried using a Message to disable and re-enable props.row.subview.enabled as a way to close the subview.  
It does not work because the table keeps in memory which row was expended.

I am really hoping for Inductive to add a way to do it.

---

<div class="post-metadata">

**Author:** ![fleclerc](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/fleclerc/32/20480_2.png) [@fleclerc](https://forum.inductiveautomation.com/u/fleclerc)\
**Post date:** [April 26, 2023, 2:13pm UTC](https://forum.inductiveautomation.com/t/feature-1985-perspective-table-close-sub-view-of-table-via-script/37995/4 "2023-04-26T14:13:10Z")

</div>

Added on [Release 8.1.17](https://inductiveautomation.com/downloads/releasenotes/8.1.17) (May 2022), Table component now has two scripting functions: **expandSubviews** and **collapseSubviews**. Both take in an array of indices of rows to expand/collapse. If no parameter with collapseSubviews, all subview are collapsed.  
Check release note 8.1.17 for full details; I havent tested it yet.
