How to open Kendo Date picker On click Inside Even Input Box using API in MVVM setup

1.3k Views Asked by At

I am using Kendo Date Picker with their MVVM support. I have date picker input like this

I want to open the Date picker on click of the input box also, currently date picker triggers on click of Date Icon

<input data-role="datepicker" id="somedateinput" name="somedateinput" 
                    data-bind="visible: true,
                               enabled:  true,
                               value: data.formattedDueDate,
                               events: { change: onChangeDate }" 
                               readonly onKeyDown="return false;" 
                               placeholder="mm/dd/yyyy" 
                               data-message="Delivery Date is Required" required  
                              onclick='open_date_picker(event)'>

Now I am not sure what to do in open_date_picker(event) function

I tried this

        open_date_picker function (event) {
           this.open(); 
        }

But its not working. Any suggestion about how to achieve this?

1

There are 1 best solutions below

0
On

Actually I just need to reattach the kendodatepicker as below to open the datepicker on click of even date.

  open_date_picker function (event) {
           $(event.srcElement).data("kendoDatePicker").open();
        }