In the vision (and perspective) equipment schedule component, I know the height of each item is currently set by the rowHeight property and applied to every row.
I have an application that would require setting a fixed height for events and having the row height be dynamic according to the number of overlapping items.
Does anybody know of a way to achieve this ?
I may be looking at the wrong component for the job but every other functionnality fits perfectly.
So... is this for Vision or Perspective?
[I'm asking this because I believe its also called Equipment Schedule in Vision too.]
The short answer is for Vision.
I know the component exist in both but I also know they are pretty different, even if they both use the rowHeight property. I believe having a dynamic rowHeight could be useful in both case.
1 Like
If I'm understanding correctly, the idea is to ensure all the rows fill the space in the equipment schedule without becoming hidden via overflow in the scroll pane?
If so, I was able to create this effect with the following propertyChange
script:
# Written for the equipment schedule's propertyChange event handler
# If the number of items change
if event.propertyName == 'items'and event.newValue.rowCount != event.oldValue.rowCount:
# Calculate the proper line height to avoid having a scroll pane
if event.newValue.rowCount > 0: # Don't divide by zero
event.source.lineHeight = (event.source.height - event.source.viewport.y) / event.newValue.rowCount
# Set the default line height for the table
else:
event.source.lineHeight = 0
Any time the number of displayed rows changes, the script recalculates the height of the rows that would be required to fill the available space and applies the resultant value to the linehieght property.