how to edit recurrenceeditor?

4 posts, 1 answers
  1. 宏吉
    宏吉 avatar
    40 posts
    Member since:
    Mar 2017

    Posted 12 Jul 2017 Link to this post

    I want remove the options day,weekend and weekday in the dropdownlist  ,how to do this?
  2. Answer
    Sayer
    Sayer avatar
    16 posts
    Member since:
    May 2016

    Posted 13 Jul 2017 Link to this post

    You can add a change event to the recurrence editor in the edit event of the scheduler (which triggers when you try to open the event editor window).

    var recurEditor = externalEditor.find('[data-role=recurrenceeditor]').data('kendoRecurrenceEditor');
                                    if(recurEditor != undefined){
                                        recurEditor.setOptions({
                                            start: new Date(e.event.start),
                                            change: function(e){
                                                //console.log('Changing Recurrence', e);
                                                var currentFreq = e.sender._frequency.value();
                                                var lastOccurrenceDate = new Date($('#startTimeInput').data('kendoDateTimePicker').value().getTime());
                                                //console.log(kendo.toString(lastOccurrenceDate, 'ddd MMM dd yyyy'));
                                                var recurrenceInterval = e.sender._container.find('.k-formatted-value.k-recur-interval.k-input');
                                               
                                                if(currentFreq == 'monthly' || currentFreq == 'yearly'){
                                                    var monthlyDataSource = e.sender._weekDay.dataSource.data();
                                                for(var i = 0; i < monthlyDataSource.length; i++){
                                                if(monthlyDataSource[i].text == 'weekday' || monthlyDataSource[i].text == 'weekend day'){
                                                        monthlyDataSource.splice(i, 1);
                                                    }
                                                }
                                                }
                                            }
                                        });
                                        
                                        
                                  }

    That example shows something I did to remove weekday and weekend day from drop down to select first, second, third, etc. weekday, weekend day, day, monday, tuesday, etc etc. in the recurrence editor. You will need to do something similar in the change event of the recurrence editor to modify its contents.

  3. Sayer
    Sayer avatar
    16 posts
    Member since:
    May 2016

    Posted 13 Jul 2017 in reply to Sayer Link to this post

    Also, setting the 'start' like I have, will determine which day checkboxes are selected in the recurrence editor based on what the start date is.
  4. 宏吉
    宏吉 avatar
    40 posts
    Member since:
    Mar 2017

    Posted 13 Jul 2017 Link to this post

    that is work thank you~~~~~
Back to Top