Feb 22, 2014, 4:25 PM
Help with styling DateField
I need to define multiple styles for a DateField. I know I can override the standard styles (ie. x-datepicker-cell), but I need to have multiple styles for my web site since it houses multiple web applications that use different themes. I'm hoping for something elegant like
.helpSection .x-datepicker-cell: hover
{
background-color: #D9E1F2 !important;
background-image: none !important;
border-color: #8EA9DB !important;
border-width: 1px !important;
border-style: solid !important;
color: #000000 !important;
}
Html.X().DateFieldFor(m => m.Request.RequestedDueDate)
.ID("dfDueDate")
.FieldCls("LabelSmallFont")
.LabelCls("LabelSmallFont")
.LabelAlign(LabelAlign.Top)
.FieldLabel("Requested Due Date:")
.MarginSpec("0 0 0 10")
.Width(178)
.EmptyText("Select a date")
.Editable(false)
// disables Saturday and Sunday, so the due date cannot fall on those days
.DisabledDays(new int[] { 0, 6 })
.ShowToday(false)
.AutoDataBind(true)
.Format("MMMM d, yyyy")
.Cls("helpSection")
instead of having to walk the elements of the control with javascript. The styles I most need to override are the hot-tracking (hover effect) on the dates, and the header of the dropdown. But, really, I'm most interested in understanding HOW to style this control... not just the answer to changing the header and hover effect. Thanks so much to anybody who can point me in the right direction.