Nested ListViews


How would I display a listView of an array within an array. I have my initial list which displays objects within an array. But those objects each have an extras property which holds an array of objects too - how to I display that extras list in a sub list in each item of the main list? I have the template sorted out, just need to know how to access the extras array in each object as I need to display those details under the details of the main objects. I’ve tried items="{{ booking_packages.extras }}" and get the error: “Binding: Property: ‘booking_packages’ is invalid or does not exist. SourceProperty: ‘booking_packages.extras’”.


Can you paste some working code for us to identify where exactly it goes wrong?


This might help you: Performance issues when updating view data


I love this example when viewed on Preview, and most of it makes sense, but you’re calling category.items in the UI binding, but I don’t see any mention of category in the JSON, just a categories array populated by exampleData. Where does ‘category’ fit in? I see in the creation of your JSON, but not in the JSON itself. Can you please advise? As that looks like a potential solution.


Of course. Do I just upload the code files? Sorry, am new here and still an amateur. :slight_smile:


If you can create a Playground example and share, it will be easy for both of us to play with it, see what actually is wrong.


let-category="item" That’s where you declare category in the template. Just have a look at the RadListView docs and it will make sense to you.


Hey guys, so taking a deeper look I see the items are displaying, but the view is only as high as the first iotem in the list and then I have to scroll to see the others - how to I circumvent that?


By default the template will be auto-height and should take how much it needs. If it occupies full screen, it must be something with your layout. Try posting the code or preferably a Playground example.


Is there somewhereI can send you the link to the Playground example? Don’t want to make it public as that example is the basis for my app - I built most of the logic for the app in the Playground version.


You can send me a direct message with the link.


Thanks, will do! When you use the app, the first page after login has a list of bookings, the list currently has one booking. Click on it, you’ll see a page with dummy data and a nested list view at the bottom. In each of the items in the list (coloured with different colours) is another list, for extras. The forst item’s extras list has two items, but you have to scroll them to see the second.