Arrays in items.add?

Is it possible to add arrays within an items.add loop? Eg something along the lines of:


for(var i=0,len=data.val.length;i<len;i++){


<Each Items="{items}">
<Each Items="{oranges}">
<Text Value="{oranges[1]}" />

Yes, adding arrays within objects is generally okay, although the syntax is different from what you’re showing here.

{oranges: ["one", "two", "three"]}

Exactly how you craft that object and nested arrays is totally up to you, and it’s a JavaScript thing.

What’s the real question though? Could you post a complete, minimal example of what you’ve tried to do and what didn’t work?


Still learning and sandboxing. Basically trying to understand best ways of using each when importing json files, but got stuck when trying to figure out how to deal with arrays, so for above example modified:

for(var i=0,len=data.val.length;i<len;i++){

Then iterating the items and within items iterate its arrays:

<Each Items="{items}">
<Text Value="{id}" />
<Each Items="{oranges}"> ???
<Text Value="{oranges[1]}" /> ???

Clearly the ??? lines is a wrong approach.

I still don’t see the complete example, and I don’t really see any specific question either. Here you go then, this is what a bucket with 3 boxes and a variable amount of fruits inside them looks like in Fuse, using vanilla JS objects and arrays:

		var types = [
			{title: "orange", count: 4},
			{title: "apple", count: 3},
			{title: "pear", count: 5}

		var bucket = [];
		types.forEach(function(t) {
			var box = {type: t.title + "s", fruits: []};
			for (var i = 0; i < t.count; i++) {
				box.fruits.push(t.title + " " + (i + 1));

		module.exports = {
			bucket: bucket
	<StackPanel Margin="4" ItemSpacing="4">
		<Each Items="{bucket}">
			<StackPanel ItemSpacing="2">
				<Text Value="{type}" Background="#ccc" />
				<Each Items="{fruits}">
					<Text Value="{}" />