# Highlight Power table row based on a drop down value

**URL:** <https://forum.inductiveautomation.com/t/highlight-power-table-row-based-on-a-drop-down-value/83566>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [December 28, 2023, 10:01am UTC](https://forum.inductiveautomation.com/t/highlight-power-table-row-based-on-a-drop-down-value/83566 "2023-12-28T10:01:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dharani\_T](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Dharani\_T](https://forum.inductiveautomation.com/u/Dharani_T)\
**Post date:** [December 28, 2023, 10:01am UTC](https://forum.inductiveautomation.com/t/highlight-power-table-row-based-on-a-drop-down-value/83566/1 "2023-12-28T10:01:06Z")

</div>

Hi ,

I have as screen with a dropdown and power table. Whenever user selects value from dropdown, i would like to highlight a row in table.Below is the code used:

```auto
	if self.parent.iTaskID is not None:
		if self.data.getValueAt(rowIndex, 'TaskID') == self.parent.iTaskID:
			return {'background': 'yellow'}
		else:
			pass

```

It is working unless click on a row in the table. But i would like to highlight as soon as the user selects a value from dropdown.

Any ideas?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 28, 2023, 11:40am UTC](https://forum.inductiveautomation.com/t/highlight-power-table-row-based-on-a-drop-down-value/83566/2 "2023-12-28T11:40:44Z")

</div>

The problem you're running into is the fact that the power table doesn't automatically paint unless an internal event within the table triggers it. You will need to do something like this from the dropdown's property change event handler:

```auto
if event.propertyName == 'selectedIndex':
     powerTable = # get the power table component

     # trigger a repaint
     powerTable.table.model.fireTableDataChanged()

```

See [this post](https://forum.inductiveautomation.com/t/animated-blinking-row-background-in-power-table/70348/3) for a more information related to this topic.

---

<div class="post-metadata">

**Author:** ![Dharani\_T](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Dharani\_T](https://forum.inductiveautomation.com/u/Dharani_T)\
**Post date:** [February 1, 2024, 4:49am UTC](https://forum.inductiveautomation.com/t/highlight-power-table-row-based-on-a-drop-down-value/83566/3 "2024-02-01T04:49:44Z")

</div>

The suggested fireTableDataChanged() is for vision.  
Like wise i have a table in perspective ,where one of the column renders a value based on a view param,  
this loads late after all other columns change or unless it touch the table or scroll it.  
i need immediate as soon as the table data fired.  
Do anyone have idea for this?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [February 1, 2024, 5:05am UTC](https://forum.inductiveautomation.com/t/highlight-power-table-row-based-on-a-drop-down-value/83566/4 "2024-02-01T05:05:29Z")

</div>

I recommend making a separate post and tagging it Perspective. It'll be more likely to be seen by the right people.
