Highlight Power table row based on a drop down value

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:

	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

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:

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

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

See this post for a more information related to this topic.

1 Like

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?

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