Wijmo User Guide > Concepts > Knockout > Two-Way Live Binding > KO Popup Binding |
Data-binding options:
Example:
In this example, the ViewModel is defined specifically for use with the pop up. It has disabled, autoHide, showEffect, and hideEffect properties that are bound in the View. If any of these values change, the widget automatically responds to them. The widget also updates the ViewModel values as it modifies them.
Create a ViewModel:
ViewModel Script |
Copy Code
|
---|---|
var viewModel = function () { var self = this; self.disabled = ko.observable(false); self.autoHide = ko.observable(false); self.showEffect = ko.observable("show"); self.hideEffect = ko.observable("hide"); }; |
Create View with Bound Controls:
View Markup |
Copy Code
|
---|---|
<div id="popup" data-bind="wijpopup: { disabled: disabled, autoHide: autoHide, showEffect: showEffect, hideEffect: hideEffect}"> </div> |