22 Replies
adverse-sapphireOP•17mo ago
This is my setup
Everything appears to be working, but the data isnt getting filtered
flat-fuchsia•17mo ago
maybe share a sandbox of this not working, because it mostly looks fine
adverse-sapphireOP•17mo 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
flat-fuchsia•17mo 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
adverse-sapphireOP•17mo 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?
adverse-sapphireOP•17mo ago
@KevinVandy how should the coldefs be? i usually only pass in handlers and things

flat-fuchsia•17mo ago
what does your data look like?
adverse-sapphireOP•17mo ago
just a flat array in this case
flat-fuchsia•17mo ago
an array of objects, right?
not an array of strings like your sandbox?
adverse-sapphireOP•17mo ago

adverse-sapphireOP•17mo ago
yes an array of strings
it doesn't like that?
flat-fuchsia•17mo ago
TanStack Table is designed to work with arrays of objects, not raw values
flat-fuchsia•17mo ago
flat-fuchsia•17mo ago
This is way more typical

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

adverse-sapphireOP•17mo ago
works
Damn
flat-fuchsia•17mo ago
and set
enableGlobalFilter: false
for any columns that are not accessing values that you want to be scannedadverse-sapphireOP•17mo ago
What a waste of a day!
Thank you @KevinVandy !!
hmm ok i have to change my api 🤦
but good
thank yo