Wijmo UI for the Web
KO DatePager Binding
Wijmo User Guide > Concepts > Integrating Frameworks > Knockout > Two-Way Live Binding > KO DatePager Binding

Data-binding options:

Example:

In this example, the ViewModel is defined specifically for use with the date pager. It has disabled, firstDayOfWeek, viewType, nextTooltip, and prevTooltip 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.firstDayOfWeek = ko.numericObservable(0); 
       self.viewType = ko.observable("week"); //day/week/month 
       self.nextTooltip = ko.observable("next"); 
       self.prevTooltip = ko.observable("previous"); 
};

Create View with Bound Controls:

View Markup
Copy Code
<div id="datepager" data-bind="wijdatepager: {
    disabled: disabled, 
    firstDayOfWeek: firstDayOfWeek,
    viewType: viewType,
    nextTooltip: nextTooltip,
    prevTooltip: prevTooltip}">
</div>
See Also

Concepts

Widgets

Reference