Matrix default values

I apologize if this has been answered - I swear I've searched for it.

I have a matrix of 5 buttons, and I want one of the buttons to be "on" by default. I tried setting the matrix's default field to an array with the 'on' value for the button I want on at the correct index, i.e. ["Alt 1", 0, 0, 0, 0], where the first button in the matrix of 5 has an on value of "Alt 1", but it does not default to being on. If I set it manually in the onCreate function, then it does turn on.

Not sure if it is not possible to set a default array of values for a matrix, or if this is a bug. Thanks for your time!

The matrix' value property is misleading, it's not dispatched to its children and you can't set the value of a matrix widget although it can be read and will return an array with the values of the matrix' children (an undocumented and somewhat questionable feature).
To dispatch an array of default values you can use the JS{} syntax in the props property:


var props = {}

var labels = ['a', 'b', 'c', 'd', 'e']
var values = ["Alt 1", 0, 0, 0, 0]

props.label = labels[$]
props.value = values[$]

return props