I have a table whose columns are connected to fields of a data collection. One of those fields is a date/time field. Unfortunately, when you display a date/time field in a column, the only option is to display MM/DD/YY. There’s no way to display the time. (If you connect a text field to a data collection there are a zillion options for date/time format display. They’re just not available in a table.)
My solution is this: Don’t connect that particular column to anything. Instead, manually modify the “columns” array of the table to add a dataPath property “displayTime” to the description of that particular column. Then iterate over the “rows” array, looking at the time (which is available already in the row), create a text version of the time, and jam that text into the “displayTime” property of the row. I have tested this and it is in fact possibly to modify the table “by hand” in this way. (Maybe there’s a better way to modify the table, or an entirely better solution—love to hear it!)
My problem is that I can’t quite figure out when I should make these modifications to the internal structure of the table. The page has a “refresh” button that refreshes the dataset that’s between the table and the data collection, but making my modifications in a .then clause of the dataset refresh is too soon; the dataset is ready but the table is not. If I put an onDataChanged handler on the table, I get an infinite loop, because my own modifications within that handler also trigger onDataChanged.
I suspect that I’m looking at this completely wrong. Can someone straighten me out?