I don’t get why this combo doesn’t work:
models/cities.js
define([], function() {
var collection = new webix.DataCollection({
data: [
{ city:"ANN ARBOR"},
{ city:"BELLEVILLE"},
{ city:"DEXTER"},
{ city:"MANCHESTER"},
{ city:"NORTHVILLE"},
{ city:"YPSILANTI"}
]
});
return {
data: collection
};
});
views/address_form.js
define(["models/cities"], function(cities) {
var addressElements = [
{
cols: [
{
view: "text",
label: "Address",
name: "address",
width: 400
},
{
view: "combo",
label: "City",
name: "city",
width: 300,
editable: true,
options: cities
},
{
view: "text",
label: "Zip:",
name: "zip",
width: 200
}
]
}
];
var addressForm = {
view: "form",
id: "addressForm",
elements: addressElements
};
var ui = {
rows: [
addressForm
]
};
return {
$ui: ui
}
});
Combo box has correct number of options but all are “undefined”.