Questions tagged [tanstack]

74 questions
3
votes
1 answer

Custom sorting TanStack Table V8

How can I sort a column if there is two values in the cells? columnHelper.accessor('violations', { id: 'violations', header: () =>

Violations

, cell: (info) => (

{info.getValue().count}

jakiehan
  • 45
  • 1
  • 6
2
votes
0 answers

React Query refetchInterval not working, only calls API once

I had used refetchInterval before and it was very straightforward. For some reason I can't get it working anymore now. This code only calls the API only once. const { data, isFetching } = useQuery( ['test'], () =>…
Aximili
  • 28,626
  • 56
  • 157
  • 216
2
votes
1 answer

How to add custom row in tanstack table v8?

I'm fairly new to tanstack/react table. I need to implement a table with a custom row that doesn't follow the column definitions, what's a good way to do this/is it possible? In my understanding, all rows need to follow the column definition, so I'm…
slhsxcmy
  • 33
  • 5
2
votes
1 answer

How to use computed properties with tanstack's vue-query?

I'm used to using Pinia/Vuex for dispatching axios requests and storing the data in the store, then using the getters for computational operations on the data. I'm using Vue 3. A simple example: let's say I have a table, I fetch the data from the…
anab1
  • 33
  • 1
  • 6
2
votes
1 answer

How to implement horizontal virtualisation in tanstack table v8?

I am building a full scale, editable, sortable table using tanstack table. I have already added virtualisation to rows using the example provided at tanstack table website. However, I also want to implement horizontal virtualisation, and I am lost…
2
votes
2 answers

react-query useQuery not refetching after useMutation

I am using react-query (actually tanstack/react-query v4) to query from and mutate a db. Based on docs and research, I gather that useQuery will automatically refetch from the server if/when the server-state differs from the cached state. However,…
welew204
  • 41
  • 7
1
vote
0 answers

TanStackTable - Solid: How do I use a Solid Store as the data source?

I have a table component that invokes createSolidTable with the following code: type TableProps = Omit, 'children'> & { data: T[] ref?: HTMLTableElement columns: ColumnDef[] pageSize?:…
1
vote
0 answers

ImportError with '@tanstack/react-virtual' module: 'useVirtualizer' not exported?

I'm encountering an issue while using the @tanstack/react-virtual library in my React project. According to the documentation, I should be able to import and use the useVirtualizer function from this module. However, when I try to import it as shown…
1
vote
1 answer

useState hook persist value across multiple function call

I am calling "deleteDepartment" function on a button to delete the department rows from my table. And from the table (I'm using shancn table which use tanstack table) to get the selected row index in "selectedRows" hook (setSelectedRows is passed as…
yanger rai
  • 102
  • 9
1
vote
1 answer

Fetching data using the Tanstack table in Next.js

What is the best practice to fetch data for Tanstack table? I have a function in the backend (NodeJS) which receives page number and page size and returns an array of data. I want to fetch the data again when changing the page number or page size,…
steve123
  • 31
  • 3
1
vote
2 answers

How to get the current Page Index of TantStack Table

I am working on building a table using TantStack and React Table libraries. I want to display the current page index in the table footer, something like "Page 1 of 8," where "1" represents the current page number, and "8" is the total number of…
hantoren
  • 357
  • 2
  • 17
1
vote
1 answer

How to invalidate cache initialData in react query/tanstack query?

I am using useQuery hook in TanStack Query (previously React Query) to cache data, in my case I config initialData depend on another hook useInfiniteQuery but when I am trying to invalidate useInfiniteQuery, cache from useQuery always immutate. In…
Epple
  • 640
  • 14
1
vote
0 answers

Tanstack table v8 - conditionally render content in cell

I have a table and would like to conditionally render a tooltip on hover of a cell. Is this possible? My content is conditionally rendered outside of the table, but won't work when adding to the cell. My onmouse events work as expected. Here is some…
user21175044
1
vote
1 answer

Tanstack react-table create column from two accessor keys

Is there any way to create a column from tanstack/react-table using two accessor keys? The data I'm receiving comes in this form: model Reminder { id String @id @default(auto()) @map("_id") @db.ObjectId userId String…
Mathew
  • 318
  • 11
1
vote
0 answers

Case sensitive Sorting in tanstack react-table v8

I want case-sensitive sorting but It's not working in Tanstack react-table v8. In the documentation I can see alphanumericCase sensitive is there. But I'm not able to understand how to apply this mode. Code: const table =…
Ankit Jaishwal
  • 496
  • 1
  • 9
  • 21
1
2 3 4 5