Perspective table editing help

Add a set of props.columns corresponding to the number of columns you want to show. In each one, set the field property to the column name, then you can make editable true, resizable true, etc. if you need to programmatically create a dynamic number of columns, you can right click-copy the entire column to get the JSON, then use:

import json
json.reads

columnJSON = '<json goes here>'
columnSet = []
for i in range(columnCount):
    columnSet.append(json.reads(columnJSON % (<if you want to use basic string transformations>)))
    columnSet[i]['field'] = 'Column Name'

myTable.props.columns = columnSet

Note that any columns you choose not to display also won’t show up in props.selection.data[0], in case you want hidden columns with extra information for any reason. A workaround is to give them a width of 0 or 1.

2 Likes