Closed paulocr closed 6 days ago
Hello,
Currently it works with litteral paths such as row.node.customerNo
or row['node']['customerNo']
I parse the callback with a string convesion + regex to retrieve the path of the nested value to highlight. In your example, it returns "row['node'][field]"
instead of "row['node']['customerNo']"
Highlighting is still experimental, and this is a good example of limitation.
I'm going to work on it.
Finally, I didn't find a way to reconstruct the path and highlight filter results when Field definition contains variables.
For highlighting, we'll need to use a callback in ThFilter
instead:
<ThFilter {table} field={row => row.node.customerNo} />
<ThFilter {table} field={row => row.node.name} />
Hello,
Thanks for your great library! I have a question when using filters and nested props.
I am using data from GraphQL so every row data is wrapped in a node object like this:
I am using a structure similar to your Hello World example trying to leverage my own version of the THFilter component.
and
in ThFilter.svelte I am setting up the filter like this:
Filtering works but the highlight does not kick in, I assume the node object wrapper messes things up but I am curious if you have any ideas.
I am using the runes version and Svelte 5 by the way.
Thanks!