1
votes

I have tried out knockout js for simple toggling of 3 div. It seems when i toggle the value by checkbox , it is working, but if I update the model value. It simply does not work properly, i have try with if and visible binding.

below is the link.

http://jsfiddle.net/xP579/1/

Best Regards

1

1 Answers

0
votes

When you define an observable with the ko.observable call it will return a function. So when you want to assign a new value to an observable you need to call it as a function with the new value as the argument:

self.goDefineForm = function () {
            self.defineParticipant(false);
            self.defineForm(true);
            self.defineOutcome(false);
}

A working JSFiddle

You can learn more about observables from the documentation.