totals etc. when filtering data #2402
Replies: 1 comment 1 reply
-
Not really, but you don't need it. A different approach which would achieve what you need would be this one: https://codepen.io/SimoTod/pen/rNzEJRW |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I asked a question on stackoverflow about how to get sums or, for that matter, totals, when filtering some data.
Finally I came to the conclusion that it is currently impossible.
In the example, the individualcount does work, as the template's root element has an x-data which gets initialized.
But it seems to be impossible to set on the template, some initialization for data a level above. Much like the first part of a traditional
for (;;)
loop.As I'm very fresh to alpinejs, I just read about it two days ago, I might miss something obvious. But if not: Maybe it's an idea to have some kind of initialization where we have an
x-for
?Beta Was this translation helpful? Give feedback.
All reactions