Table event handlers - event.column "int & str" return type? + How to get edited column index?

image

I need to know the column index so that I can use the index to update the underlying table, but the event.column return type, according to the info in the intelli popup, is an “int & str”. Not sure what that means?
What it actually is returning, is the column name as a str. Is there a simple way to get the int index to use with table.setValueAt, or am I going to have to use something dumb like
system.dataset.getColumnHeaders(ds), loop through it and find the index of the header that way?

you can use both colName or colIndex to set value in a dataset

That makes more sense. I was looking at the api instead of the user manual :roll_eyes: cheers

Datasets also have a getColumnIndex() method.

1 Like

Note that internally, everything is using the index. So setValue using the column name is going to do a linear scan of the column names looking for a match. In practice, given how many columns a typical dataset has, this isn’t really a performance problem.