Hi,
I seem to be having an issue with data binding to dropdown templates.
I’ve supplied a sample variable to the page javascript
state.testItems = [
{
name: "Test 1",
items: [
{ name: "Subtest 1", items: [] },
{ name: "Subtest 2", items: [] },
],
},
{
name: "Test 2",
items: [
{ name: "Subtest 3", items: [] },
{ name: "Subtest 4", items: [] },
]
}
];
And I’ve gone ahead and thrown in the dropdown template, giving it a repeat for each of the testItems
Meanwhile the Text component (Dropdown… above) is bound to state.testItemsItem.name.
The text does not seem to bind; rather, it shows up as “undefined.” But it does repeat twice, once for each item in the array.
I’m wondering if we’re going about this wrong and need to be binding some other way?
When I replicate the structure without the template, the bindings seem to be valid and not undefined.
Is there a separate way to create a dropdown without having to use the template, if templates are the issue?
Thanks.