When I get the table component from the [perspective components] it is filled with 50 records en 3 columns. The columns are equal divided in the table on screen. According user manual columns should to be resized but this is not working. I can not adjust the width and hovering in runtime is also not working.
Manual mentions 2 methods to modify column width but both are not working
- When resizable is enabled: users can resize columns in the runtime by hovering over the edge.
2.The width of this column. If resize is enabled, specifies the column width on initial load. User can override this in the runtime if the Resizable option is enable
Can’t help you, but someone who can will need to know ignition version
1 Like
Thank you for your reply The Ignition version is 8.0.10
- yes
- yes but when you reopen the page it will go to initial setup.
For me, I have add ‘width’ setting for column and ‘strictwidth’ is true to get the width working as I need. and ‘resizable’ is true so I can change the width on fly but goes to default as I reopen the popup as I used the Table in my popup.
Hello,
I find the cause The columname in props.data must be filled in props.Column.field.
1 Like
Late to the party but I had something similar I was doing and needed to see what I could do to fix the resizing problem. This gets us a Tag History in Tall Format.
I wanted to grab some random tags and be able to get the Tag history into as needed. Took some work to get used to the query function but the below code will need and do:
- Text filled for your tag path
- A perspective table to put the data on
- An event button to place the code
- All named accordingly as you would like.
Will read one tag path, get the query history for that one tag path, put it in a table, Then add the header to that tables columns with a resizable property as being True so the User change manually change the column sizes.
Code:
def runAction(self, event):
# Define the headers for your new dataset
headers = ["path", "value", "quality", "timestamp"]
data = []
# Get the tag path
path = self.getSibling("TagPathTextField").props.text
# Query the tag history
results = system.tag.queryTagHistory([path], system.date.addDays(system.date.now(),-1), system.date.now(), aggregationMode = "LastValue",returnFormat='Tall')
system.perspective.print(results.getColumnNames())
# Iterate over each row in the results
for i in range(results.getRowCount()):
# Access the columns of the row using the dataset's getValue method
tagpath = results.getValueAt(i, "path")
value = results.getValueAt(i, "value")
quality = results.getValueAt(i, "quality")
timestamp = results.getValueAt(i, 'timestamp')
data.append([tagpath, value, quality,timestamp])
# Create a new dataset with your headers and data, and assign it to your custom property
dataSet = system.dataset.toDataSet(headers, data)
self.getSibling("TagHistTable").props.data = dataSet
# Dynamically adjust the width of the columns
columns = []
for header in headers:
columns.append({"field": header, "resizable" : True}) # Adjust the width as needed
self.getSibling("TagHistTable").props.columns = columns