Filtering Table

I'm hoping this is a silly question and an easy fix, but when i'm filtering my table by t_stamp and selecting most current date why does it not save on the Ignition client?

my current table's first selected row is the first entry into the db, but i would like it to show the last entry into the db.

image image

Help would be appreciated thanks.

Filtering and ordering on a table via the header are user operations, not designer operations. The table always starts with the order of the supplied dataset. If you wish that to always be a certain order, arrange that in the query binding that supplies it.

(Or use an expression or script to reorder, perhaps using my orderBy() expression function.)

2 Likes

If u don´t want change the query you may try

In your script:


table = event.source.parent.getChild("YourTable")

# Set the first row as selected after data is loaded
if len(table.props.data) > 0:
    table.props.selection.data = [{"row": 0}]

1 Like

Thanks @pturmel didn't think to change the query, sorted now.

Thanks @Alejandro_Alaco cool solution didn't know i could do this.