I’m currently trying to accomplish two things in a regular table:
- Using propertyChange scripting, I want to make it so that when a selected row’s value is in an array of items I want to exclude, a messageBox pops up to tell the user that item is deprecated, as well as make the selected row value equal to -1
- Using getForegroundAt under extension functions, I’d like to be able to return a grey for values that are in this same array.
This is what I have for each function
if event.propertyName=='selectedRow': currValue = self.data.getValueAt(event.source.selectedRow,event.source.selectedColumn) if currValue in deprecatedValues: #deprecatedValues is an array of values system.gui.messageBox("Sorry, this value is no longer used. Please select a new one") event.source.selectedRow =- 1 ``` 2.getForegroundAt ``` currValue = self.data.getValueAt(row,col) if currValue in deprecatedValues: return 'grey' else: return defaultColor
The error I’m running into is “NameError: name ‘self’ is not defined”
This refers to my lines of
currValue = self.data.getValueAt(event.source.selectedRow,event.source.selectedColumn)
Is this not how I should access these values?