3 Answers, 1 is accepted
0
Hello Logan,
You can use the OnClientFormCreated event to change the recurrence as demonstrated below:
Regards,
Peter Milchev
Progress Telerik
You can use the OnClientFormCreated event to change the recurrence as demonstrated below:
<script>
function
OnClientFormCreated(sender, args) {
var
$ = $ || $telerik.$;
if
(args.get_formElement().classList.contains(
"rsAdvancedEdit"
)) {
if
(sender.get_renderMode() == 2) {
//lightweight render mode
var
recurrenceDropdown = $(args.get_formElement()).find(
".RecurrenceEditor .RadDropDownList"
)[0].control;
if
(recurrenceDropdown.get_selectedItem().get_value() ==
"None"
) {
// select another item
recurrenceDropdown.get_items().getItem(1).select();
}
// remove the 'Never' option
recurrenceDropdown.get_items().removeAt(0);
}
else
if
(sender.get_renderMode() == 1) {
// classic render mode
var
recurrenceCheckBox = $(args.get_formElement()).find(
".RecurrenceEditor .rsAdvChkWrap input[type='checkbox']"
);
if
(!recurrenceCheckBox.prop(
"checked"
)) {
recurrenceCheckBox.click();
}
$(
".RecurrenceEditor .rsAdvChkWrap"
).hide();
}
}
}
</script>
Regards,
Peter Milchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Logan
Top achievements
Rank 1
Veteran
answered on 16 Oct 2018, 05:26 PM
How do I wire to the ClientFormCreated event? I am not seeing it in the Scheduler.Events or DataSource.Events.
I am using the MVC fluent methods to build the scheduler in my view and I cannot find the ClientFormCreated in under the Scheduler.Events nor the DataSource.Events.
0
Hello Logan,
The suggestions are for the RadScheduler for ASP.NET AJAX as this is the forum for the UI for ASP.NET AJAX suite.
Anyways, the same functionality can be achieved for the Kendo UI products in the edit event as demonstrated in this dojo example - http://dojo.telerik.com/@pmilchev/aRozadeS
Regards,
Peter Milchev
Progress Telerik
The suggestions are for the RadScheduler for ASP.NET AJAX as this is the forum for the UI for ASP.NET AJAX suite.
Anyways, the same functionality can be achieved for the Kendo UI products in the edit event as demonstrated in this dojo example - http://dojo.telerik.com/@pmilchev/aRozadeS
- https://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist/methods/select;
- https://docs.telerik.com/kendo-ui/api/javascript/ui/scheduler/events/edit
edit:
function
(e) {
var
ddl = e.container.find(
"[data-role='recurrenceeditor'] .k-dropdown input"
).data(
'kendoDropDownList'
)
if
(ddl) {
var
data = ddl.dataSource.data();
data = data.slice(1, 5);
ddl.setDataSource(data);
if
(!e.event.recurrenceRule) {
ddl.select(0)
ddl.trigger(
"change"
);
}
}
}
Regards,
Peter Milchev
Progress Telerik