# Perspective table, row selection, glitch on sort

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-row-selection-glitch-on-sort/114725>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 27, 2026, 1:53pm UTC](https://forum.inductiveautomation.com/t/perspective-table-row-selection-glitch-on-sort/114725 "2026-03-27T13:53:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![travisaggiebrown](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/travisaggiebrown/32/85824_2.png) [@travisaggiebrown](https://forum.inductiveautomation.com/u/travisaggiebrown)\
**Post date:** [March 27, 2026, 1:53pm UTC](https://forum.inductiveautomation.com/t/perspective-table-row-selection-glitch-on-sort/114725/1 "2026-03-27T13:53:13Z")

</div>

I have a table in Ignition where selecting a row takes the row’s ID and uses it to run a query. I also have a button that clears the selection by setting `selection.data`, `selectedRow`, and `selectedColumn` to `null`.

In addition, I have a script that sorts the dataset based on user inputs. The sorting happens _before_ the data reaches the table, not using the table’s built-in sorting (I mention this because I’ve read that the table’s native sorting can be finicky).

Despite all selection values being set to `null`, as soon as a sort occurs the **0th index row becomes selected**. Even if I run a script after filtering/sorting to explicitly clear the selection, the 0th row is still selected. Also worth noting: even after setting the selection properties to `null`, the row remains visually highlighted.

This initially led me to believe the selection state was being stored somewhere on the JavaScript side. However, after digging through the view, I confirmed that all JavaScript selection-related keys are indeed `null`. Even after the sort triggers the row selection, the JavaScript objects still show no selection — which now leaves me wondering if the data is stored somewhere in Narnia.

At this point, I’m stumped on how to circumvent this behavior. I’ve tried toggling `enableRowSelection` to `false` and back to `true`, but that had no effect. I’ve also tried setting `selectedRow` and `selectedColumn` to `-1` and then back to `null`, with no success.

If anyone has ideas on how to fully clear the selection and unhighlight the row, I’m all ears.

_(Edit: bullied — fairly, I may add.)_

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 27, 2026, 2:25pm UTC](https://forum.inductiveautomation.com/t/perspective-table-row-selection-glitch-on-sort/114725/2 "2026-03-27T14:25:16Z")

</div>

Consider editing your post to have actual paragraphs made of sentences, proper use of upper case, and organized points. Then volunteers like me won't halt partway through your wall of jumbled text.  
🤷‍♂️

---

<div class="post-metadata">

**Author:** ![travisaggiebrown](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/travisaggiebrown/32/85824_2.png) [@travisaggiebrown](https://forum.inductiveautomation.com/u/travisaggiebrown)\
**Post date:** [March 27, 2026, 2:41pm UTC](https://forum.inductiveautomation.com/t/perspective-table-row-selection-glitch-on-sort/114725/3 "2026-03-27T14:41:04Z")

</div>

sorry, was at my wits end when I typed that, I'm more collected now. I edited it so its coherent and readable

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [March 27, 2026, 2:49pm UTC](https://forum.inductiveautomation.com/t/perspective-table-row-selection-glitch-on-sort/114725/4 "2026-03-27T14:49:08Z")

</div>

JavaScript? Not in Perspective…

There have been other posts about the tricky nature of deselecting a table row:

> [@Deselect and Un-Highlight Table Row](https://forum.inductiveautomation.com/t/deselect-and-un-highlight-table-row/79014/6):
>
> The most reliable way I've found to do this is to disable row selection, let that bounce over to the browser, which will then clear props.selection.data. A change event on props.selection.data can then re-enable row selection when it sees the new empty value. In general, properties that are set via user interaction in the browser, like selections, need to also be unset by the browser. Unsetting them directly via script (which runs in the gateway, not the browser) is unreliable.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 27, 2026, 2:51pm UTC](https://forum.inductiveautomation.com/t/perspective-table-row-selection-glitch-on-sort/114725/5 "2026-03-27T14:51:08Z")

</div>

I would highly recommend @pturmel's [Integration Toolkit](https://forum.inductiveautomation.com/t/automation-professionals-integration-toolkit-module/74934) to do dataset manipulations in an expression to dodge scripting transforms. Much faster and efficient.

Double check and make sure that you don't have an accidental copy/pasted change script that is setting the selection to index 0.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 27, 2026, 2:51pm UTC](https://forum.inductiveautomation.com/t/perspective-table-row-selection-glitch-on-sort/114725/6 "2026-03-27T14:51:21Z")

</div>

Ryan beat me to re-posting my own advice... 😆

The key is to **not** set the selected row to null, but to let the browser do it.

---

<div class="post-metadata">

**Author:** ![travisaggiebrown](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/travisaggiebrown/32/85824_2.png) [@travisaggiebrown](https://forum.inductiveautomation.com/u/travisaggiebrown)\
**Post date:** [March 27, 2026, 3:26pm UTC](https://forum.inductiveautomation.com/t/perspective-table-row-selection-glitch-on-sort/114725/7 "2026-03-27T15:26:06Z")

</div>

That did it. For some reason, my designer was using cached data or something, and it was driving me crazy. I had a button that set `enableRowSelection` to `false`, but it would set it to `true`.

I restarted my designer and setting it to `false` initially and then having the dataset script enable it on update, did the trick. The only downside was that I had to add a sleep timer of .02 between disabling it and refreshing the table’s data binding 🤮 seems there’s some race condition.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 27, 2026, 3:28pm UTC](https://forum.inductiveautomation.com/t/perspective-table-row-selection-glitch-on-sort/114725/8 "2026-03-27T15:28:35Z")

</div>

> [@travisaggiebrown](#):
>
> there’s some race condition.

Yes, a browser round trip.
