# Collapse remaining of the selected

**URL:** <https://forum.inductiveautomation.com/t/collapse-remaining-of-the-selected/80267>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 10, 2023, 10:51am UTC](https://forum.inductiveautomation.com/t/collapse-remaining-of-the-selected/80267 "2023-10-10T10:51:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vignesh\_H](https://avatars.discourse-cdn.com/v4/letter/v/f475e1/32.png) [@vignesh\_H](https://forum.inductiveautomation.com/u/vignesh_H)\
**Post date:** [October 10, 2023, 10:51am UTC](https://forum.inductiveautomation.com/t/collapse-remaining-of-the-selected/80267/1 "2023-10-10T10:51:29Z")

</div>

Hi  
Here am using table to show some data..  
my requirements is when i expand one row, remaining three row need to collapse  
There is any default setting is there in perspective?

first image - all collapsed  
second image - rows expand

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/1/71f0729ae667ffd7a0af45e1bfa0aa74764899a2.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/7366cf1c6c34eb3914a4be39550517d985f504be.png)

---

<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 10, 2023, 2:37pm UTC](https://forum.inductiveautomation.com/t/collapse-remaining-of-the-selected/80267/2 "2023-10-10T14:37:08Z")

</div>

There's no built-in functionality that I'm aware of. You should be able to do something like this within the `onSubviewExpand` component function:

```python
# untested code
index_list = list(range(len(self.props.data))) # determine what other rows might need to be collapsed
index_list.remove(event.rowIndex) # but not the row which was just expanded
self.collapseSubviews(index_list) # now collapse those remaining

```

Note that this would only work for _manual_ expansion; anything you do with scripting might not trigger this.

---

<div class="post-metadata">

**Author:** ![vignesh\_H](https://avatars.discourse-cdn.com/v4/letter/v/f475e1/32.png) [@vignesh\_H](https://forum.inductiveautomation.com/u/vignesh_H)\
**Post date:** [October 11, 2023, 4:32am UTC](https://forum.inductiveautomation.com/t/collapse-remaining-of-the-selected/80267/3 "2023-10-11T04:32:26Z")

</div>

Hi  
Thanks for your reply.  
there is one option in subviewExpansionMode, I put it in single.

its working fine.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d8f00e881a2e17e048a3b1ed0b6200942f241d0e.png)
