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

ap..navigate finish event?

3 Answers 161 Views
Application
This is a migrated thread and some comments may be shown as answers.
Lumir
Top achievements
Rank 1
Lumir asked on 26 Aug 2013, 01:20 PM
Hi,

we want to change the title in navbar according to some global variables.
after navigating to another application page via app.navigate('ksettings.html') it's not possible to call title method of the navbar, eg.

$("#photonavbar").data("kendoMobileNavBar").title( g_models.ParamsVM.valSpecNames.join(' ' ) );

because $("#photonavbar").data("kendoMobileNavBar") is undefined.
Event indicating all kendo structures are initiated would be usefull.

How to track that page was succesfully navigated and all kendo structures are instantiated?

Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 28 Aug 2013, 09:11 AM
Hi Lumir,

There is not event that is fired when the app.navigate() finishes loading. But I would suggest you to take a look at the event fired when a view is loaded - the one that you navigate to, for example afterShow event.

Please check this link for more information:

http://docs.kendoui.com/api/mobile/view#events-afterShow

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Brandon Peterson
Top achievements
Rank 2
answered on 07 Feb 2014, 11:28 PM
Lumir, for those occasions where a callback function would be more appropriate than the afterShow event (which would fire every time the view is navigated to) you can use the following method:

navigate: function (url, transition, fnComplete) {
            if (transition && fnComplete) {
                var view = $(url);
                if (view) {
                    view.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function () {
                        fnComplete();
                        $(this).unbind(); //remove transitionend listener
                    });
                }
                this.pane.navigate(url, transition);
            } else {
                this.pane.navigate(url, transition);
            }
        }

Attached is the unminified modification of kendo.mobile.application.js (Q3 2013.3.1220).
0
Brandon Peterson
Top achievements
Rank 2
answered on 07 Feb 2014, 11:32 PM
Note: this approach only works when specifying a view transition in order to programmatically handle the destination view afterShow event
Tags
Application
Asked by
Lumir
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Brandon Peterson
Top achievements
Rank 2
Share this question
or