Can't I sort the contents of the list view?

When importing text from a DB to a list view, i think the contents are sorted alphabetically in the list view. Can't i sort this in chronological order?

When you request the data from the DB,
can you request it in chronological order?

Is the DB tag/value, or is the DB SQL based?

It is DB tag/value

I will assume the data has a date/time field in it that you can extract, and that you can format it as yyyyMMDDhhmmss, which works very well for time order, because time order matches text order in this format.

Make a new TinyDB Namespace for sorting, with tag = the yyyyMMDDhhmmss of the record, and value = the text of the record, in CSV row or JSON format.

You will need a few phases for your Extract, Transformation, and Load (ETL):

  • clear the tinyDB
  • get the data from the db, tag by tag
    • for each incoming tag/value
    • build a new yyyyMMDDhhmmss tag from the incoming data and add it to the TinyDB Namespace
    • add it to the TinyDB under the new tag
  • (end of loading into TinyDB)
  • set a global Elements list to empty list
  • for each tag in TinyDB taglist (naturally sorted by TinyDB)
    • get that tag/value
    • format the tag/value into a nice Element text value for your ListView
    • add the Element to your global Elements list
  • (end for each tag)
  • set the ListView .Elements to global Elements
1 Like