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

Mobile back button error on click

3 Answers 155 Views
Button (Mobile)
This is a migrated thread and some comments may be shown as answers.
Ety
Top achievements
Rank 1
Ety asked on 31 Jan 2013, 03:32 PM
Hi,

I am trying to use kendo.mobile.ui.BackButton inside a navbar, in a mobile web application (mvc.net).
When taping the button I get the following error and then nothing happens:

TypeError: Result of expression 'e' [undefined] in kendo.mobile.min.js:12

here is my layout code (i'm using kendo version 2012.3.1114):

<div data-role="layout" data-id="mobileLayout">
            <header data-role="header">
                <div id="headerNavBarDiv" data-role="navbar">
                    <a id="backBtn" class="nav-button" data-align="left" data-role="backbutton">Back</a>
                    <div id="homeIconDiv" class="smallTempHomeIcon"></div>
                    <a id="showProjectHistory" data-align="right" data-role="button" data-icon="icon historyLight" style="display: none"></a>
                </div>
                <div id="titleDiv"></div>
            </header>
        </div>
        <script>
            var app;
            $(document).ready(function () {
                app = new kendo.mobile.Application($(document.body), { layout: "mobileLayout" });
            });
        </script>


As I understand from your documentation and lots of forum reading - this should be an easy one, but nothing I tried worked (including using the data-click or adding 'href=#:back')

I'll more then appreciate your help in this matter.

Thanks,
Ety 



kendo.mobile.min.js:12

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 04 Feb 2013, 12:30 PM
Hi Ety,

Your KendoUI code looks OK. I assume that the problem is caused by multiple initialization of the mobile application which is not supported (re-initialization of the Application will reset the history).

Are you by any chance initializing the application in the _Layout page of the MVC project? If yes, please move the initialization code at the index page where the initial view is located. Also there is not need to use the document.ready event.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ety
Top achievements
Rank 1
answered on 04 Feb 2013, 01:38 PM
Hi Alexander,
Thank you for your reply.

You are correct - I do initialize the application in the _Layout page.
I tried moving it to my first view like you suggested, but when I navigate to the next view - I don't see the layout at all...

Any idea why?


Thanks,
Ety


0
Alexander Valchev
Telerik team
answered on 06 Feb 2013, 08:13 AM
Hi Ety,

Thank you for the feedback. I am glad to hear that the initial problem has been resolved.
I am afraid that this time I cannot guess where exactly the problem comes from. Can you please verify that the application is initialized only once in the index page (it should not be initialized again in the other Views)?

If this is not the case, please send me a small example that isolates the problem. In this way I would be able to examine your implementation in details and assist you further. Thank you in advance for the cooperation.

Best regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Button (Mobile)
Asked by
Ety
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Ety
Top achievements
Rank 1
Share this question
or