Vision - Limit rows on a table or remove vertical scroll

Hi everybody,
How could I limit the number of rows on a table?¿ Is it possible to remove the vertical scroll and keep the lasts X rows visible?¿
Thanks in advance,
Guillem

You can limit the number of rows by using a LIMIT claus in your query that populates the table.

How are you populating the table, from a database ? SQL LIMIT claus

Hi CraigB
Thanks for your answer.
No, It is not a query. I get the values from a function - Alarm events.
There is any way to limit the rows there?¿

Not in the alarm status or journal tables directly, you would need to make your own.

Something like this should help.

# Get all alarms and get the latest 'limit' number of items

limit = 5

# End up with a PyDataSet, so that we can easily slice it.
alarms = system.dataset.toPyDataSet(system.dataset.sort(system.alarm.queryStatus().getDataset(), 'EventTime', False))

newDataSet = alarms[:limit]

Many Thanks JordanCClark,
but I don’t see where to call the script…
I use directly a Power table

You could make a custom property on the power table that contains all of the data, then run Jordan’s script in the propertyChange script of the power table. When the value of the custom property changes, you would use Jordan’s code to get the smaller dataset and write that value to the data property of the table.

1 Like