I am new to KnockoutJs and I am wondering if anyone can help with this.
I have a viewmodel populated from an Mvc3 controller linked to a drop down list and this works fine.
I have additional data stored in the "platform" of the observed array, and I would like this data to be displayed in text boxes, depending on the value selected in the drop-down list.
Here is my code: -
<script type="text/javascript"> $(document).ready(function () { var sampleSubmission = function () { this.selectedPlatform = ko.observable(); this.platforms = ko.observableArray(); this.showSearch = ko.observable(false); this.craftText = ko.observable(); this.showSerialNumber = ko.observable(0); this.selectedPlatform.subscribe(function (platformId) { } .bind(this)); }; var sampleSubmissionViewModel = new sampleSubmission(); ko.applyBindings(sampleSubmissionViewModel); </script>
Does anyone have any ideas how I achieve this?
Thanks in advance.
source share