Hey everyone!
It’s my first time working with the ‘Data View’ component, and it seems pretty straight-forward going by the tutorials, but I’m having a really hard time figuring it out. I hope you can help me out. (v4.0.1, NodeJs)
So I have my API data loaded via serverconnect, works great with the repeaters… But when I introduce the data view component (using the same serverconnect as a source, of course) to get some sorting going, the repeaters (now using the ‘Data view’ as a data source) don’t seem to work.
The only configuration on the data view component is the source.
Any idea why this is the case?
A data view would not be the widget to use here. If you can, sort in the db lookup or otherwise in the server action. Or you can sort using formatters attached to your server connect results on the repeat itself.
The problem is that my data comes from an external API… I might be wrong, but I doubt there’s a server action one can use in sorting/filtering or manipulating external api response.
About attaching formatters to the serverconnect results, please, how do I go about that?
Also, when would you say is an ideal situation to use the data view component?
You can perfectly use the data view for client side sorting or filtering. Only if you have indeed large datasets then server side filtering and sorting is preferred.
When using dataview you have to bind it indeed to tge server connect data source and apply sort and filter as required.
Then where you display the data you bind indeed to tge data view data and not the original server connect data of course.
You can check the included real estate demo project. It shows a simple dataview usage for sorting and filtering.
Thanks @mebeingken
That’s exactly what I did @George… Did not work still.
I think it might have something to do with NodeJs templating because I just ran another test (created a new page with no predefined ‘layout/template page’ selected ), and it seemed to work.
Oh and regarding server-side manipulation for external api data, is sorting, filtering, deleting a json/response element possible? If it is, do we have any guides/tutorials for that?