# Table component Drag row

**URL:** <https://forum.inductiveautomation.com/t/table-component-drag-row/5226>\
**Category:** Ignition\
**Created:** [October 2, 2012, 7:43pm UTC](https://forum.inductiveautomation.com/t/table-component-drag-row/5226 "2012-10-02T19:43:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pdalwalla](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pdalwalla](https://forum.inductiveautomation.com/u/pdalwalla)\
**Post date:** [October 2, 2012, 7:43pm UTC](https://forum.inductiveautomation.com/t/table-component-drag-row/5226/1 "2012-10-02T19:43:31Z")

</div>

We are in need to drag rows from a table and place them between other rows within the same table to rearrange the order or priority. We maintain a column for priority and that will change based on insertion of rows between other rows.

Is there a way to do this? How best can we achieve this if not available directly?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [October 2, 2012, 7:48pm UTC](https://forum.inductiveautomation.com/t/table-component-drag-row/5226/2 "2012-10-02T19:48:40Z")

</div>

You won’t be able to drag rows and place them between other rows. The best you can do is put buttons on the window that a user can press that will move a row up or down by changing the priority column value. You can sort a table by any column in scripting:`table = event.source.parent.getComponent("Table")
table.sortByColumn("priority")`

---

<div class="post-metadata">

**Author:** ![pdalwalla](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pdalwalla](https://forum.inductiveautomation.com/u/pdalwalla)\
**Post date:** [October 2, 2012, 7:50pm UTC](https://forum.inductiveautomation.com/t/table-component-drag-row/5226/3 "2012-10-02T19:50:34Z")

</div>

We may have to move the rows from the bottom to the top of a list with 10s of rows. A button will only allow one move at a time; is that correct?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [October 2, 2012, 8:55pm UTC](https://forum.inductiveautomation.com/t/table-component-drag-row/5226/4 "2012-10-02T20:55:16Z")

</div>

No, you can move multiple. Just set the “Selection Mode” property of the table to “Multiple Interval” so you can select multiple rows. In your script you can call a function to get all of the selected rows:[code]table = event.source.parent.getComponent(“Table”)  
rows = table.getSelectedRows()  
for row in rows:

# do something with each row[/code]
