I have an observable CommitteeTypes which holds an array of objects:
self.CommitteeTypes = ko.observableArray();
self.init = function() {
self.CommitteeTypes([
{
Meeting: {descr: 'Committee', meeting_type_id: 'C' },
Ranks: [{}, {}, ...],
Roles: [{}, {}, ...]
}
]);
}
And then I have a Select dropdown:
<select data-bind="options: $root.CommitteeTypes, optionsText: function(item) { return item.Meeting.descr; }, optionsValue: Meeting.comm_meeting_type, optionsCaption: 'Select...'"></select>
The OptionsText binding works and returns "Committee" as expected, but the OptionsValue binding does not work, it throws an error: "Reference Error: Meeting is not defined", and if I wrap it in quotes it just leaves the value empty.
The object passed in is what I expect, as I'm able to access it via the lambda, but without that this doesn't work. Did I miss something? I have almost this exact same binding working on another page (minus the lambdas). But I can't seem to figure out what I've done wrong here.