Skip to content

Is there a way to add a filter and sort method inside the table ? #600

Answered by wiktoriavh
thibaudbrault asked this question in Q&A
Discussion options

You must be logged in to vote

inside your Virtuoso table you have the prop data={yourData}. In an earlier call you can manipulate yourData and pass that to virtuoso, instead of manipulating it inside of it.

function YourTable() {
  const data = /* where you get your data from */;
  const [yourData, setYourData] = useState(data);

 function filterData() {
    // your manipulation
  setYourData(/* your result fo manipulation */)
  }

  return <VirtuosoTable
                data={yourData}
                /* other code */
              />
}

Also, is it possible to give a classname to the table tag when using TableVirtuoso ?

you can make a custom table element by passing it into the components

function YourTable() {
  r…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by petyosi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants