22 Replies
extended-salmonOP•2y ago
This is my setup
Everything appears to be working, but the data isnt getting filtered
wise-white•2y ago
maybe share a sandbox of this not working, because it mostly looks fine
extended-salmonOP•2y ago
https://codesandbox.io/p/sandbox/misty-architecture-qpdqqv?file=%2Fsrc%2FcolDefs.tsx%3A18%2C48
@KevinVandy hows this?
haven't really created sandboxes like this before
wise-white•2y ago
There's some interesting things I see with your column defs and data, I guess
in this sandbox the accessors don't access anything
so the global filter has nothing to match with
extended-salmonOP•2y ago
accessors
let me see
oh i didn't send the data in
but why does it paint the table?
let me see if i made the same dumb mistake in my app
no that seems to be the right pattern?
extended-salmonOP•2y ago
@KevinVandy how should the coldefs be? i usually only pass in handlers and things

wise-white•2y ago
what does your data look like?
extended-salmonOP•2y ago
just a flat array in this case
wise-white•2y ago
an array of objects, right?
not an array of strings like your sandbox?
extended-salmonOP•2y ago

extended-salmonOP•2y ago
yes an array of strings
it doesn't like that?
wise-white•2y ago
TanStack Table is designed to work with arrays of objects, not raw values
wise-white•2y ago
wise-white•2y ago
This is way more typical

extended-salmonOP•2y ago
oh really? eh i havent had this problem yet
this is like my 10th table
and its rendering
wise-white•2y ago
The object could have just 1 key
extended-salmonOP•2y ago
ok ill transform it and see
thank you!!
<FilterTable data={[{ value: "a" }, { value: "c" }, { value: "b" }]} />
so if the data looks like this
wise-white•2y ago
then the
accessorKey could be "value"
and the global filter would be able to match that accessorextended-salmonOP•2y ago

extended-salmonOP•2y ago
works
Damn
wise-white•2y ago
and set
enableGlobalFilter: false for any columns that are not accessing values that you want to be scannedextended-salmonOP•2y ago
What a waste of a day!
Thank you @KevinVandy !!
hmm ok i have to change my api 🤦
but good
thank yo