yogeswaran K
yogeswaran K

Reputation: 2288

wijmo date picker using in textbox

I need examples for using the wijmo date picker in a text box. I am having trouble in using wijmo date picker. It is working when I am using in div but not in textbox

here is my code:

<%:  Html.TextBox("sample")%>

$(document).ready(function () {
    $("#sample").wijcalendar({ 
        easing: 'easeInQuad' 
    });
});

Upvotes: 1

Views: 1307

Answers (1)

Banzor
Banzor

Reputation: 1122

You still need the div for the calendar itself, but then attach the calendar show option to the input.

<%: Html.TextBox("sample")%>    
<div id="calendar"></div>
$("#calendar").wijcalendar({
    popupMode: true,
    selectedDatesChanged: function () {
        var selDate = $(this).wijcalendar("getSelectedDate");
        if (!!selDate) $("#sample").val(selDate.toDateString());
    }
});

$("#sample").click(function () {
        $("#calendar").wijcalendar("popup", {
            of: $("#sample"),
            offset: '0 2'
        });
    })
});

Upvotes: 2

Related Questions