I am having trouble to hide one option in recurrence editor in a standardized way. I have tried to hide it by custom code but it sometimes creates not predictable behaviour.
This is what I am trying to hide:
I am having trouble to hide one option in recurrence editor in a standardized way. I have tried to hide it by custom code but it sometimes creates not predictable behaviour.
This is what I am trying to hide:
You need to handle the edit event of the scheduler and hide that option via jQuery:
function scheduler_edit(e) {
// find the recurring dropdownlist
var dropdown = e.container.find("[data-role=dropdownlist]").data("kendoDropDownList");
// handle its change event
dropdown.unbind("change", hide_never);
dropdown.bind("change", hide_never);
}
function hide_never() {
// hide the <li> element that contains the "Never" radio option
$(".k-recur-end-never").closest("li").hide();
}
You also could make this:
in the edit
event of the widget:
var recurrenceEditor = e.container.find("[data-role=recurrenceeditor]").data("kendoRecurrenceEditor");
//set start option value, used to define the week 'Repeat on' selected checkboxes
recurrenceEditor.setOptions({
start: new Date(e.event.start),
change: function (e) { onRecurrenceEditor_Change(e,this); }
});
and then:
function onRecurrenceEditor_Change(e, obj) {
var buttonNever = obj._buttonNever;
if (buttonNever) {
$(buttonNever[0]).parent().remove();
}
}
I just got a response from Telerik's support, which I pay for. Splice the dropdown's data and re-set it:
edit: function (e) {
// remove Yearly" from re-occurence dropdown
var ddl = $('input[title="Recurrence editor"]').data('kendoDropDownList');
if (ddl) {
var data = ddl.dataSource.data();
data = data.slice(0, 4);
ddl.setDataSource(data);
}
},