Hide Table Column

Trying to hide column(s) on the propertyChange event handler of the table. I am using the below code but the column index is off. As you see below “0” should hide the first column, it hides the second column, 1 hides the 3rd column and so on… Should i be doing this a different way?


table = event.source
data = table.data

if variable == "true":
	table.columnAttributesData = fpmi.dataset.setValue(table.columnAttributesData,0,"hidden",1)

The rows in the columnAttributes datasets don’t have to match the order of the columns in the displayed dataset. You need to search the columnAttributes to find the matching column name and then set the hidden flag. And if not found, construct a new row from scratch with the hidden flag set.

Thanks, i just figured that out, when i printed the columnAttributesData dataset. Now I am having major designer issues when I set two columns to hidden and test it. My designers stops working and everything freezes up for some time and eventually i can get it to stop. Takes several minutes.

table = event.source
data = table.data

if variable == "true":
   table.columnAttributesData = fpmi.dataset.setValue(table.columnAttributesData,0,"hidden",1)
   table.columnAttributesData = fpmi.dataset.setValue(table.columnAttributesData,4,"hidden",1)

I don’t see a check against event.propertyName in your script (I assumed you trimmed it). If you don’t have one, then the script re-triggers over and over again (since you are setting a property, creating another event).
What property change are you trying to respond to? (It cannot be columnAttributes, see above).

Actually, since you are assigning to columnAttributes twice in the script, you are creating two new events for every event processed…