Is there a way to add a filter and sort method inside the table ? #600
-
I'm currently using virtuoso for rendering a table and before that I was using vanilla React JS.
Is it possible to add it ? If not is there something equivalent for a search field and for the sorting ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
inside your Virtuoso table you have the prop 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 */
/>
}
you can make a custom table element by passing it into the components function YourTable() {
return <VirtuosoTable
components={{
Table: (props) => /* <our custom table here */
/* other code */
/>
} |
Beta Was this translation helpful? Give feedback.
inside your Virtuoso table you have the prop
data={yourData}
. In an earlier call you can manipulateyourData
and pass that to virtuoso, instead of manipulating it inside of it.you can make a custom table element by passing it into the components