Create list of parts in ComboBox
Looping over score's parts seems to be the best way to retrieve all staff's names in order to display them in a ComboBox (which does not work yet...).
I try this:
var staffList
for (var i = 0; i < score.parts.length; i++) {
staffList.push({id: i, partName: score.parts[i].partName}
}
// this only prints [Object object]
console.log(staffList.length)
How do I have to define and shape the array in order to be able to assign it to a ComboBox?
Thank you!
Comments
Define it as a model, rather than as a var. Then assign it to the combobox after populating it.
See https://github.com/jeetee/MuseScore_UltraStar_Exporter/blob/master/Ultr… and the use of the
staffList
variable there.