# Select all rows in a perspectives table

**URL:** <https://forum.inductiveautomation.com/t/select-all-rows-in-a-perspectives-table/77475>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 4, 2023, 6:06pm UTC](https://forum.inductiveautomation.com/t/select-all-rows-in-a-perspectives-table/77475 "2023-08-04T18:06:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwagner](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bwagner](https://forum.inductiveautomation.com/u/bwagner)\
**Post date:** [August 4, 2023, 6:06pm UTC](https://forum.inductiveautomation.com/t/select-all-rows-in-a-perspectives-table/77475/1 "2023-08-04T18:06:41Z")

</div>

I have a table that I am using as a schedule to send data to a plc. I would like to be able to have a select all button to select and highlight all the rows in the table so I can iterate through them to send to the plc. Any help on the select all would be appreciated.

---

<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:** [August 4, 2023, 6:09pm UTC](https://forum.inductiveautomation.com/t/select-all-rows-in-a-perspectives-table/77475/2 "2023-08-04T18:09:24Z")

</div>

The table's `props.data` has that information for you.

---

<div class="post-metadata">

**Author:** ![bwagner](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bwagner](https://forum.inductiveautomation.com/u/bwagner)\
**Post date:** [August 17, 2023, 5:59pm UTC](https://forum.inductiveautomation.com/t/select-all-rows-in-a-perspectives-table/77475/3 "2023-08-17T17:59:10Z")

</div>

This won't highlight the row though. I know I can iterate through the props.data and send everything but I need them to be able to select them all. Also on a touch screen there is no way to multi select without a keyboard and have them highlight.

---

<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:** [August 17, 2023, 8:49pm UTC](https://forum.inductiveautomation.com/t/select-all-rows-in-a-perspectives-table/77475/4 "2023-08-17T20:49:00Z")

</div>

The Perspective table doesn't seem to expose the properties that you want. I checked by copying the `data` property into `selection.data` and it doesn't apply highlighting to cells.

---

<div class="post-metadata">

**Author:** ![bwagner](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bwagner](https://forum.inductiveautomation.com/u/bwagner)\
**Post date:** [August 18, 2023, 2:07pm UTC](https://forum.inductiveautomation.com/t/select-all-rows-in-a-perspectives-table/77475/5 "2023-08-18T14:07:09Z")

</div>

Does anyone know of a creative work around

---

<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:** [August 18, 2023, 3:08pm UTC](https://forum.inductiveautomation.com/t/select-all-rows-in-a-perspectives-table/77475/6 "2023-08-18T15:08:57Z")

</div>

Unfortunately, `Table.props.selection.data` is read-only, and writing data to that property will not modify the state or appearance of the Table. The primary reason for this is that there is no guarantee of uniqueness in Table data.

Imagine you had a Table with a single column "x" (just to keep the example simple), and it only had three rows:

```auto
  x
-----
  1
  2
  1

```

Suppose now that you wrote the row data for the 2th (3rd) row with the expectation that the 2th row would display as selected. Well... `{"x": 1}` actually defines the underlying data of two rows, so which should be selected?

There's no good work around, because there is no current way for the Table to dynamically or systematically have selection applied to it.

A _bad_ workaround is to add a new column to the Table (and your data) as the 0th column, render it as a boolean field (checkbox or toggle), and use some external component (perhaps a Button) to set the underlying value of the data to have all rows selected. You would also then need to supply your OWN style to each row to designate the row as selected.

---

<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:** [August 18, 2023, 3:29pm UTC](https://forum.inductiveautomation.com/t/select-all-rows-in-a-perspectives-table/77475/7 "2023-08-18T15:29:12Z")

</div>

> [@cmallonee](#):
>
> A _bad_ workaround

I'm not so sure that isn't better. Particularly with touchscreens.

---

<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:** [August 18, 2023, 4:41pm UTC](https://forum.inductiveautomation.com/t/select-all-rows-in-a-perspectives-table/77475/8 "2023-08-18T16:41:21Z")

</div>

Perhaps, but I'm always hesitant whenever I suggest driving behaviors in one component via a second component.

---

<div class="post-metadata">

**Author:** ![bwagner](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bwagner](https://forum.inductiveautomation.com/u/bwagner)\
**Post date:** [August 19, 2023, 11:25am UTC](https://forum.inductiveautomation.com/t/select-all-rows-in-a-perspectives-table/77475/9 "2023-08-19T11:25:10Z")

</div>

The work around which might be "bad" seems like that it would be better than what I was going to try which I'm not sure was going to work. I started looking in to seeing if I could do it with java script injection by capturing the pointer event and adding ctrl. Haven't got far though, never did anything with java script.
