How would I execute a custom function when any date has been selected?
I searched for examples, but couldn't find a function that takes into consideration dynamic datepicker ID/class.
Can we add a custom function here without using Events? Or if we have to use events, can we pass the datepicker id/class to the function -- if so how?
My markup:
@(Html.Kendo().DatePicker()
.Name(@Model.Name)
.Footer(
"Today - #= kendo.toString(data,'ddd, MMM dd, yyyy') # "
)
.Min(
"1/1/1900"
)
.Max(
"1/1/2200"
)
.Events(e => e.Close(
"onClose"
))
//.Enable((Model.SelectedValues != null && Model.SelectedValues.Length > 0) || !Model.AllowNullValue)
.Value(string.IsNullOrEmpty(Model.SelectedValues)
?
null
: Model.SelectedValues
.Replace(
"[OneMonthAgo]"
, DateTime.Now.AddMonths(-1).Date.ToString())
.Replace(
"[OneYearAgo]"
, DateTime.Now.AddYears(-1).Date.ToString())
.Replace(
"[CurrentDate]"
, DateTime.Now.Date.ToString())
)
.HtmlAttributes(
new
{ AllowNullValue = Model.AllowNullValue.ToString().ToLower(), Prompt = Model.Prompt, onblur =
"DatePickerChangeHandler(this)"
, Class =
"DatePicker"
})
)