This is a migrated thread and some comments may be shown as answers.

Custom View Doesn't Destroy when Selecting Another View

2 Answers 75 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 02 Dec 2015, 08:50 PM

Hello,

 

I created a project following the same methods as this project to build a scheduler with custom views. The issue I'm running into is that the code

 

//detach events
        destroy: function () {
            if (this.element) {
                this.element.off(NS);
            }
            ui.SchedulerView.fn.destroy.call(this);
        }

never executes when I select another view. Instead, the view stays in place and the view I selected appears below it. If I toggle between my two custom views, they will simply stack. Is there any reason you now of why this might happen? Let me know if I need to upload a project, but it will take time to make it so it can be downloaded and run with minimal changes.

 

Thanks for your help!

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 04 Dec 2015, 02:22 PM
Hello Derek,

The view destroy method is called, when the widget itself is destroyed: If you listen to event that is triggered when the events are changed, then wire: or
Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Derek
Top achievements
Rank 1
answered on 07 Dec 2015, 07:05 PM

Hi Georgi,

 

Thank you very much for your reply. I'm not sure why this was, but the solution to my conundrum was to add an option to my custom views. While I had already included the option:

 

 

selectedDateFormat: "{0:D} - {1:D}"

I added this option:

 

 

selectedShortDateFormat: "{0:d} - {1:d}"

And suddenly switching views worked perfectly.

Tags
Scheduler
Asked by
Derek
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Derek
Top achievements
Rank 1
Share this question
or