Hello Markus,
I have noticed that the duration combobox causes postback. I suggest you set the end time based on the duration selection client-side and avoid the postback.
AdvancedForm.ascx
AdvancedForm code behind
AdvancedForm.js
var
endTimePicker =
null
;
var
startTimePicker =
null
;
* * *
_initializePickers:
function
() {
// Show picker pop-ups when the inputs are focused
var
showPopupDelegate = Function.createDelegate(
this
,
this
._showPopup);
var
templateId =
this
._templateId;
this
._pickers =
{
"startDate"
: $find(templateId +
"_StartDate"
),
"endDate"
: $find(templateId +
"_EndDate"
),
"startTime"
: $find(templateId +
"_StartTime"
),
"endTime"
: $find(templateId +
"_EndTime"
)
};
endTimePicker =
this
._pickers.endTime;
startTimePicker =
this
._pickers.startTime;
* * *
function
Duration_OnClientSelectedIndexChanged(sender, args) {
var
endTimeView = endTimePicker.get_timeView();
var
startTimeView = startTimePicker.get_timeView();
var
startTime = startTimeView.getTime();
if
( args.get_item().get_value() !=
"-"
)
endTimeView.setTime(startTime.getHours(),
startTime.getMinutes() + parseInt(args.get_item().get_value()),
startTime.getSeconds(),
startTime);
}
Attached is a simple demo for reference.
All the best,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and
book your seat for a walk through all the exciting stuff we ship with the new release!