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

Views not displayed when using document.addEventListener

3 Answers 195 Views
View
This is a migrated thread and some comments may be shown as answers.
devApps
Top achievements
Rank 1
devApps asked on 07 Dec 2016, 11:33 AM

I have a  simple home page with multiple views and I want only the first one to be displayed.

It is fine When I initialize the app using 

var app = new kendo.mobile.Application();

But when I use document.addEventListener() with deviceReady on a real device it displays all the views and in dojo it does not display anything

Here is the code snippet that I am trying 

    var app;
    var onDeviceReady = function() { 
            //navigator.splashscreen.hide(); 
            app = new kendo.mobile.Application(document.body,
            {
                platform:'ios7'
            });
    }
    document.addEventListener('deviceready', onDeviceReady, false); 

 

http://dojo.telerik.com/@phcc1t/AtiVo/2

Views with document.addEventListener()

Could you please let me know where am I going wrong ?

 

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 09 Dec 2016, 08:56 AM
Hi,

The device ready event does not fire in a Dojo. Did you tested it in a Cordova application?

Regards,
Alexander Valchev
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
0
devApps
Top achievements
Rank 1
answered on 11 Dec 2016, 07:34 AM
Yes I tested it on a real device. It displays all the views . I need to display only the first one
0
Alexander Valchev
Telerik team
answered on 13 Dec 2016, 04:07 PM
Hi,

Most probably the code that initialises the mobile application is not executed. Please verify that the init event of the application fires (you may simply put an alert) and check for JavaScript errors when application is ran on device. This might give us a clue what is going wrong.

Regards,
Alexander Valchev
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.
Tags
View
Asked by
devApps
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
devApps
Top achievements
Rank 1
Share this question
or