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

How to execute callback after the navigate (to a new view) has completed

2 Answers 390 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Grant asked on 12 Jan 2017, 07:42 AM

Hi, 

As my title says, I'm trying to execute a method/callback after the user has navigated to a new view (ie, month) as I'd like to make changes to the structure of the calendar in month view.

I see that the 'navigate' callback execute before the change, is there some way to execute a method after new view is loaded?

Thanks,
Grant

2 Answers, 1 is accepted

Sort by
0
Accepted
Peter Milchev
Telerik team
answered on 13 Jan 2017, 02:25 PM
Hello Grant,

One option to achieve the described result is to use the .one() method of the observable objects as demonstrated in this Dojo example:

function myFunc(){
    kendoConsole.log("from navigate after databound")
}
 
function scheduler_navigate(e) {
  e.sender.one('dataBound', myFunc)
 
  kendoConsole.log("navigate");
}

The .one() method attaches a handler to an event and the handler is executed only once. 

Here are some other resources you might find useful:
Regards,
Peter Milchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
answered on 16 Jan 2017, 08:52 AM

Thanks Peter, 

The .one method does exactly what I want, I will however look into creating a custom month view as well.

Thanks,
Grant

Tags
Scheduler
Asked by
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Peter Milchev
Telerik team
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Share this question
or