Tuesday, September 1, 2015

How to set Knockout Radio Button with a Default Value

If you want to set default value for radio button checked, you need to use an observable attribute with variable values, and each one is a real value for one radio button.

within  data-bind = "checked: TransferType"

TransferType: ko.ovservible("room")  <== Init value

for radiobutton's onchange() event, within the c# code:

ViewModel.TransferType("floating");

No comments:

Post a Comment