Hi
I'm having issues with table component,
It seems that there are not enough space to show the information on the row,
Because when I click in to the row I can see the information from the query.
Regards
Hi
I'm having issues with table component,
It seems that there are not enough space to show the information on the row,
Because when I click in to the row I can see the information from the query.
Regards
There are multiple configurations you can play with.
We don't know much about how you've set things up, so it might prove difficult to provide accurate help.
Perspective - Table | Ignition User Manual
You can set the row height to 'auto' like a css property and it will adjust accordingly, if that is what you wish to happen. But as @pascal.fragnoud mentioned there are many other factors like position.shrink properties and so on.
I'm using the following code to create the table
data = self.parent.custom.Result
self.props.data = []
rowcount = self.parent.custom.RowCount
columns = self.props.columns
self.custom.Adds = []
self.custom.Edits = []
newRow ={}
for row in range(rowcount):
for col in columns:
if col.field == 'PartNumber':
value = data.getValueAt(row,0)
enable = False
display = True
elif col.field == 'CastingArea':
value = data.getValueAt(row,1)
enable = True
display = True
newRow[col.field] = {"value": value, "enabled":enable, "display":display, "style":{}}
self.props.data.append(newRow)
self.props.selection.selectedRow = -1
self.props.selection.selectedColumn = -1
self.props.selection.selectedRow = None
self.props.selection.selectedColumn = None
whoa, that's... not how you should be doing this. I can't right now, but I'll try to explain in more details tomorrow.
But that's also completely irrelevant to rows height.
That code shows how you're building the table's data, now how it's configured to display things.
You should be looking at how the embedded view is set up: Make sure it can grow to fit its content, Then as Dillon said, set the row's height to auto. That's in the table's properties.
You certainly don't want to be modifying props like this until the very end of the script as this will kill your performance
Put a binding on your table's data
property. Make it a property binding, to the source data (the one you point to with self.parent.custom.result
).
Add a script binding with this:
return [
{
'PartNumber': value.getValueAt(row, 0),
'CastingArea': value.getValueAt(row, 1)
} for row in range(value.rowCount)
]
Set the enable
, visible
and such in the column configuration.
This may be simplified further, depending on a bunch of variables for which we don't have much information.