Column Hiding

(newbie)I really could use a basic example, wasted too much time on this

I merely want a table column’s visibility to be driven from say a checkbox or a button event.
I thought maybe I could use something like:
[color=#004040]table=event.source.parent.getComponent(“Table”)
system.dataset.setValue(table.columnAttributesData,1,3,0)[/color]

Maybe it’s working but I’ve called out incorrect column?

What is easy way to confirm which column is visibility/hide ?

Thanks! Would love to end week having solved this

You were close. Just need to write the data back to the table.
Also, you want column 2 not 3 if you want to the hide attribute.

table=event.source.parent.getComponent('Table')
if event.source.selected : #This is the check box I created.
	newData = system.dataset.setValue(table.columnAttributesData,1,2,1)
	table.columnAttributesData = newData
else:
	newData = system.dataset.setValue(table.columnAttributesData,1,2,0)
	table.columnAttributesData = newData

or you could lose the if statement since it is a check box.

table=event.source.parent.getComponent('Table')
newData = system.dataset.setValue(table.columnAttributesData,1,2,event.source.selected)
table.columnAttributesData = newData

Cheers,
Chris

That’s it, I VERY much appreciate it