Вопрос

I have a super basic PhoneGap iOS solution, but it does not appear that Kendo UI is initializing. I am using Kendo UI Mobile 2013 Q1 build with PhoneGap 2.6

I cannot seem to spot the problem.

Here is my Code

    <!DOCTYPE html>
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 -->
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <title>Hello World</title>

        <script type="text/javascript" src="cordova-2.6.0.js"></script>
        <script type="text/javascript" src="js/index.js"></script>
        <script src="js/jquery.min.js"></script>
        <script src="js/kendo.mobile.min.js"></script>
        <script type="text/javascript" src="js/kendo.all.min.js"></script>
        <script src="js/custom.js"></script>
        <script src="js/datasource.js"></script>
        <script type="text/javascript" src="js/script.js"></script>
        <link href="styles/kendo.common.min.css" rel="stylesheet" />
        <link href="styles/kendo.bootstrap.min.css" rel="stylesheet" />
        <link href="styles/kendo.common.min.css" rel="stylesheet" type="text/css">
        <link href="styles/kendo.mobile.all.min.css" rel="stylesheet" type="text/css">
        <link href="styles/styles.css" rel="stylesheet" type="text/css">

    </head>
    <body>
        <div data-role="view" id="main">
            <a href="#page2" data-role="button">Go to Page 2</a>
        </div>
        <div data-role="view" id="page2">
            My Page 2
        </div>


        <script type="text/javascript">
            //cordovaApp.initialize();
        </script>

        <script>
            document.addEventListener("deviceready", onDeviceReady, false);

            function onDeviceReady() {
                app = new kendo.mobile.Application() {
                    transition: "slide",
                    platform: "ios"
                }



            </script>

     </body>
</html>
Это было полезно?

Решение

Ok, figured it out:

<script type="text/javascript">
            $(function() {
              document.addEventListener("deviceready", onDeviceReady, false);
              function onDeviceReady() {
              // Now safe to use the Cordova API
              var app = new kendo.mobile.Application()
              }

              }); 

            </script>

Другие советы

In your script reference, you are using kendo.mobile.min.js and kendo.all.min.js. Only one must be used as everything in mobile.min.js is in kendo.all.min.js and it will mess up the entire app. Once you remove kendo.mobile.min.js , your app should work.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top