# Maintaining table sort order when navigating between views

**URL:** <https://forum.inductiveautomation.com/t/maintaining-table-sort-order-when-navigating-between-views/89270>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 23, 2024, 9:52am UTC](https://forum.inductiveautomation.com/t/maintaining-table-sort-order-when-navigating-between-views/89270 "2024-04-23T09:52:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bfreeman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfreeman/32/87436_2.png) [@bfreeman](https://forum.inductiveautomation.com/u/bfreeman)\
**Post date:** [April 23, 2024, 9:52am UTC](https://forum.inductiveautomation.com/t/maintaining-table-sort-order-when-navigating-between-views/89270/1 "2024-04-23T09:52:52Z")

</div>

Hi,

I am trying to sort data (binding on a tag which is being written to every 5min) in a table on the timestamp column by default.

The sort works well on a page refresh but not when navigating through the project's pages (with an HorizontalMenu for example).

![table_sort](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/f/bf05ebb8287e7210ab572c5e48b1a21238e0a9b2.gif)

Is this behavior expected?

Tested on Ignition 8.1.39

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 23, 2024, 10:29am UTC](https://forum.inductiveautomation.com/t/maintaining-table-sort-order-when-navigating-between-views/89270/2 "2024-04-23T10:29:11Z")

</div>

Good news.

> New in 8.1.5  
> A boolean **runWhileHidden** property can be added to an element that's set to an object data type. This setting determines if contents of this tab loads once the tab is first activated, and if it should persist while in the background when the **currentTabIndex** changes.[image]

![runWhileHidden](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/b/cb48013f386e6bdacb92f32891626d9983f25204.png)

At the moment your tabs will be an array in the form,

```python
tabs
  0 : Label0
  1 : Label1

```

- Right-click on the tab to be configured as `runWhileHidden`, Change To, Object.
- Add two values to the object, `text` and `runWhileHidden`. It should then look like the image above.

> **[Perspective - Tab Container | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-container-palette/perspective-tab-container)**
>
> The Tab container uses tabs as navigation buttons arranged together with the selected tab highlighted.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 23, 2024, 10:35am UTC](https://forum.inductiveautomation.com/t/maintaining-table-sort-order-when-navigating-between-views/89270/3 "2024-04-23T10:35:24Z")

</div>

I've taken the liberty of editing your post title to clarify the topic in search results. It may help someone else. I hope that's OK with you.

---

<div class="post-metadata">

**Author:** ![bfreeman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfreeman/32/87436_2.png) [@bfreeman](https://forum.inductiveautomation.com/u/bfreeman)\
**Post date:** [April 23, 2024, 11:19am UTC](https://forum.inductiveautomation.com/t/maintaining-table-sort-order-when-navigating-between-views/89270/4 "2024-04-23T11:19:40Z")

</div>

@Transistor it's not a tab view. _Home_ and _Table_ are separate **pages**

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 23, 2024, 11:38am UTC](https://forum.inductiveautomation.com/t/maintaining-table-sort-order-when-navigating-between-views/89270/5 "2024-04-23T11:38:27Z")

</div>

> It's not a tab view.

Aw, no. And I was so happy with myself. I've put the title back.

Tip: I think they are separate **views** , not pages. The Perspective client runs everything in one page and swaps in and out the views without reloading the page or without loading another page. Someone may clarify further.

It may be possible to save the sortOrder to a session variable. I'll have a think.

---

<div class="post-metadata">

**Author:** ![bfreeman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfreeman/32/87436_2.png) [@bfreeman](https://forum.inductiveautomation.com/u/bfreeman)\
**Post date:** [April 23, 2024, 11:58am UTC](https://forum.inductiveautomation.com/t/maintaining-table-sort-order-when-navigating-between-views/89270/6 "2024-04-23T11:58:52Z")

</div>

I say **pages** because it is using Ignition's **page navigation** (the end of the URL is updated from /Home to /Table which are my configured pages)

I added a Label with a binding to sortOrder to see whether the props is set after navigation.

It seems that it is the case:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/0/70194fb0a27a20c3b58e13ea60742ac4a589abea.png)

---

<div class="post-metadata">

**Author:** ![Jesse\_D](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@Jesse\_D](https://forum.inductiveautomation.com/u/Jesse_D)\
**Post date:** [January 21, 2025, 12:19am UTC](https://forum.inductiveautomation.com/t/maintaining-table-sort-order-when-navigating-between-views/89270/7 "2025-01-21T00:19:31Z")

</div>

Is there a solution to this thread? I've recently encountered the same issue myself. The table sort order only works on the first load of the page, after navigating away it loses the sort order.
