I am having trouble duplicating an array that I need in order for the user to select from the dropdown.
The dropdown is sized properly, but the values are all blank. I have copied these arrays from search.html/search.js where they work perfectly.
This is a new view - customer - and the values are blank.
my html code:
<td class="small index_table border">
<label for="client">
Client:
</label>
<select name='client' value.bind="selectedClient">
<option model.bind="null"></option>
<option repeat.for="client of clients"
model.bind="client.client">
${client.client}
</option>
</select>
</td>
<td class="small index_table border">
<label for="cust_info_field">
Info:
</label>
<select name='cust_info_field' value.bind="selectedCustInfo">
<option model.bind="null"></option>
<option repeat.for="info of custInfoField"
model.bind="info.value">
${info.display}
</option>
</select>
and my js code:
export class Customer {
constructor(api) {
this.selectedClient = 0;
this.clients = [
{ clt_id: 0, client: 'AC Moving' },
{ clt_id: 1, client: 'Air Van' },
{ clt_id: 2, client: 'Berger' },
{ clt_id: 3, client: 'Berger Escalated' },
{ clt_id: 4, client: 'Berger Term Drivers' },
{ clt_id: 5, client: 'Morse Moving' },
{ clt_id: 6, client: 'Nor-Cal' },
{ clt_id: 7, client: 'Pyramid' },
{ clt_id: 8, client: 'Reliable' },
{ clt_id: 9, client: 'Santini' },
{ clt_id: 10, client: 'SMMoving' },
{ clt_id: 11, client: 'Stratosphere' }
];
this.selectedCustInfo = 0;
this.custInfoField = [
{ value: 'All', display: 'All' },
{ value: 'Name', display: 'Name' },
{ value: 'Contacts', display: 'Contacts' },
{ value: 'City', display: 'City' },
{ value: 'My Notes', display: 'My Notes' },
{ value: 'All Notes', display: 'All Notes' },
{ value: 'Report As', display: 'Report As' },
{ value: 'Parent Customer', display: 'Parent Customer' },
];
}
}
My custInfo dropdown did have values in it until i added the this.selectedCustInfo = 0;
, so I am not sure what is going on, or what I’ve done wrong. Especially as it worked fine in another view.