简体   繁体   English

Kendo UI:Append在移动模拟器上不起作用

[英]Kendo UI : Append does not work on mobile simulator

I am new with kendo ui. 我是Kendo ui的新手。 I am using Kendo UI for my new phonegap project that is developed usin xCode. 我将Kendo UI用于在xCode中开发的新phonegap项目。 I had creates a html page which append tag. 我创建了一个HTML页面,其中附加了标签。 It work properly when I test on browser. 当我在浏览器上测试时,它可以正常工作。 But the same doesn't work in iOS simulator. 但是在iOS模拟器中却无法使用。

Below is my current code: 下面是我当前的代码:

    <!DOCTYPE html>
<html>
    <head>
        <title>Basic usage</title>
        <meta charset="utf-8">
           <script type="text/javascript" src="js/Initial.js"></script>
    </head>

    <body>

         <div data-role="view" id="drawer-listSurvey" data-layout="drawer-layout" data-title="Create Survey">

            <div>
                <ul data-role="listview" class="inboxList" id="new-questions">

                </ul>

                <ul data-role="listview" data-style="inset">
                    <li data-icon="add"><a data-role="button"data-rel="actionsheet" href="#actionsheet">Add Question</a></li>
                    <li data-icon="organize"><a>Add Page</a></li>
                </ul>


            </div>

            <div id="footer">
                <ul id="actionsheet" data-role="actionsheet" data-popup='{ "height": "auto", "width": 200, "direction": "left" }'>
                    <li></li>
                    <li><a onclick="addMultipleChoice()">Multiple Choice</a></li>
                    <li><a>Dropdown</a></li>
                    <li><a>Comment Box</a></li>
                    <li><a>Image</a></li>
                    <li><a>Text Description</a></li>
                </ul>
            </div>
        </div>



        <div data-role="layout" data-id="drawer-layout">
            <header data-role="header">
                <div data-role="navbar">
                    <a data-role="button" data-rel="drawer" href="#my-drawer" data-icon="drawer-button" data-align="left"></a>
                    <span data-role="view-title"></span>
                    <a data-role="button" data-align="right" data-rel="actionsheet" href="#actionsheet">+</a>
                </div>
            </header>
        </div>

        <script>
            kendo.mobile.ui.Drawer.current = null;
            </script>

        <script>
            function addMultipleChoice(){
                $("#new-questions").append("<div id=\"question\"><ul>Wich is the vowel?<li><input type=\"checkbox\"/><label>A</label></li><li><input type=\"checkbox\"/><label>B</label></li><li><input type=\"checkbox\"/><label>C</label></li><li><input type=\"checkbox\"/><label>D</label></li></ul></div>");
            }
        </script>


    </body>
</html>

Any help will be appreciated. 任何帮助将不胜感激。

Thanks in advance 提前致谢

In general using jQuery append() to add items to a Kendo UI Mobile ListView is not supported and not recommended. 通常不建议使用jQuery append()向Kendo UI Mobile ListView添加项目。 You should use the Kendo UI's append method, as shown here: 您应该使用Kendo UI的append方法,如下所示:

http://docs.telerik.com/kendo-ui/api/mobile/listview#methods-append http://docs.telerik.com/kendo-ui/api/mobile/listview#methods-append

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM