This is a migrated thread and some comments may be shown as answers.

Cannot set width of DatePicker

2 Answers 1176 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Nilhan
Top achievements
Rank 1
Nilhan asked on 30 Jul 2012, 11:23 AM
I'm having trouble setting up the width of DatePicker. There's no way in Kendo API to set this on initialization. I tried in-line style with !important attribute, but it only limits the width of text box keeping the lengthy wrapper unchanged.

Is there a way around this?

2 Answers, 1 is accepted

Sort by
0
John DeVight
Top achievements
Rank 1
answered on 09 Aug 2012, 12:05 PM
Hi Nilhan,

How about this:

$("#datepicker").closest("span.k-datepicker").width(400);

Regards,

John DeVight
0
Casey
Top achievements
Rank 1
answered on 13 Aug 2012, 12:36 AM
For me I just applied the datePicker to a standard input field and used style="width: 120px" and it worked fine for me.  Have you tried this route?

Casey

<input id="DatePicker" readonly="true" onchange="DoThisFunction();"  style="width: 120px;" onclick="$('#DatePicker').data('kendoDatePicker').open();"/>
Tags
Date/Time Pickers
Asked by
Nilhan
Top achievements
Rank 1
Answers by
John DeVight
Top achievements
Rank 1
Casey
Top achievements
Rank 1
Share this question
or