How to generate a table from a queryContent().find() result? #1297
Unanswered
MasterNayru
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to make a table of a fixed width and am having quite a bit of trouble trying to work out how to do it. I am doing a queryContent().find() call and I can see that data comes back from my query, but I want to display this data in a table and I don't know how to, for example, chunk the result into blocks on length N or even get the length of the result of the query. It doesn't behave like an array and my atttempts to iterate through the collection and push elements into an array also have not worked.
Is there some example that someone could give that shows how to generate a table from a query result?
Edit: Gosh, reading through the source code managed to allow me to work out what I was doing ... I don't want to say wrong, but if I use queryContent().find() I can actually get the length out and work with it, but if that call is wrapped in useAsyncData() I then get back a collection of DataT back, and I have no idea how to get the length out. Anyway, my immediate issue isn't blocking me any more but would still like to understand what the safest way to run these queries would be when I want to be able to know how many items I have in a collection.
Beta Was this translation helpful? Give feedback.
All reactions