ProofKit - table filter, sort and changing header names

If I change the header names, deviating from the names in FMS, the data and new header show fine. But the table filter and sort functions no longer work.

That is, for columns where the header name deviates from the original FMS column name value.

A bug or user error??

ProofKit, once setup, is very useful. Hope it is given more prominence going forward. A great contribution to the community. Thanks Proof+Geist.

If all you changed was the header value (line 32 in your screenshot) then that should not break anything. Those are for display only. However, the field names must match in the accessorFn property. If field names change in FileMaker you’ll need to run the typegen command again to surface those errors and correct them.

What I suspect is more likely happening is that you’re trying to sort on a timestamp value and there are large discrepancies between how JavaScript and FileMaker handle dates/times. To properly sort timestamps, you’ll need to convert the data format returned by the accessorFn from a string (the default) to a JS date object, then set the sortingFn property on that column to datetime. For parsing dates, I suggest the dayjs library (which I think is already be installed in your ProofKit project)

The underlying JavaScript package here is Mantine React Table v2 which is based on Tanstack Table. You may need to check their respective docs for more details.

Hi Eric.

The timestamp sort and filter work fine. I am not using FileMaker timestamps, rather the native (text) timestamps generated by a third-party db API.

The problem persists. Whatever the column, if the column label changes, not the underlying FileMaker field label, then neither sort or filter work.

The same applies to my timestamp field; but only if I change its table column label as well.

It’s good to know the behavior I describe should not occur. On the other hand, the occurrence is a problem.

Thank you so much for taking the time … much appreciated.

  • Steve

Eric,

You will find the same problem with the ProofKit demo file. One cannot change the table column headers without breaking the filter and sort functions.

  • Steve