Views not displayed when using document.addEventListener

4 posts, 0 answers
  1. devApps
    devApps avatar
    36 posts
    Member since:
    Dec 2015

    Posted 07 Dec 2016 Link to this post

    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 ?

     

  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2886 posts

    Posted 09 Dec 2016 Link to this post

    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.
  3. devApps
    devApps avatar
    36 posts
    Member since:
    Dec 2015

    Posted 11 Dec 2016 in reply to Alexander Valchev Link to this post

    Yes I tested it on a real device. It displays all the views . I need to display only the first one
  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2886 posts

    Posted 13 Dec 2016 Link to this post

    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.
Back to Top