Looking into making the test suite proposed in #14 more generic, I ran into a limitation: When loading table information from a JSON source, it is not possible to have the source data be the plain text content of the cell, and apply a transformation on that data before storing it as the cell's data-value.
This means that a simple case-folding operation to support case-insensitive sorting is currently not possible, which seems like an unfortunate oversight.
Currently. a function called dataFilter can be provided in the configuration, which to me sounds like it would affect the data-value attribute of the cell rather than the text content. Additionally, filter is perhaps not the best name for something that doesn't actually filter.
I propose adding two new attributes to the column configuration:
textTransform which takes the JSON field value and generates the text content for the cell;
valueTransform which takes the JSON field value and generates the data-value for the cell.
The current dataFilter could then be kept backwards compatible by making is equal to the textTransform.
This would be good for tests, but also users who have similar requirements for case-insensitive sorting (mine are solved by generating the HTML server-side, but loading from JSON, it would be a definite need).
Looking into making the test suite proposed in #14 more generic, I ran into a limitation: When loading table information from a JSON source, it is not possible to have the source data be the plain text content of the cell, and apply a transformation on that data before storing it as the cell's
data-value
.This means that a simple case-folding operation to support case-insensitive sorting is currently not possible, which seems like an unfortunate oversight.
Currently. a function called
dataFilter
can be provided in the configuration, which to me sounds like it would affect thedata-value
attribute of the cell rather than the text content. Additionally, filter is perhaps not the best name for something that doesn't actually filter.I propose adding two new attributes to the column configuration:
textTransform
which takes the JSON field value and generates the text content for the cell;valueTransform
which takes the JSON field value and generates thedata-value
for the cell.The current
dataFilter
could then be kept backwards compatible by making is equal to thetextTransform
.This would be good for tests, but also users who have similar requirements for case-insensitive sorting (mine are solved by generating the HTML server-side, but loading from JSON, it would be a definite need).