Is there a table component?
Hi, I'm new here.
Just wanted to know if there's a table component I can import.
I need a dashboard and a table page that shows users can see their product database they put in.
2 Replies
Hi @TCempire. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. Wasp does not provide a built-in table component. However, it does provide automatic CRUD (Create, Read, Update, Delete) operations that you can use to interact with your database. You can use these operations to fetch data from your database and display it in a table format using a table component from a library of your choice.
For example, you can use the
getAll
query to fetch all records of a certain entity from your database. Here is an example of how you can use it:
In this example, Tasks.getAll.useQuery()
is used to fetch all tasks from the database. You can replace Tasks
with the entity that represents your products.
For the table component, you can use any React table library that you prefer, such as react-table
or material-table
.
For more information, you can check out the Wasp documentation on CRUD (https://wasp-lang.dev/docs/data-model/crud#using-the-generated-crud-operations-on-the-client).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @TCempire, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Hey @TCempire, Wasp doesn't have its own official UI table component, if that's what you're asking.
You can use any UI table library you want and install it as a dependency.