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

template not displaying data on mobile

2 Answers 74 Views
Templates
This is a migrated thread and some comments may be shown as answers.
Jose
Top achievements
Rank 1
Jose asked on 20 Mar 2014, 02:42 PM
Hi,

So, im using a template binded to remote data. Everything works well on the emulator but on the device only the button appears.
code:

    <form>
            <ul id="books" data-template="template" data-role="listview" data-style="inset" data-bind="source:fields"></ul>
            <button data-role="button" id="save" type="button" class="login-button">Save</button>
  </form>
   <script id="template" type="text/x-kendo-template">
           <li >
                    <label for="page">#: Caption #</label>
                    # if (EditConfigType =="Lookup"){
                    #<select id="dropdown"></select>#
                    }
                    if (EditConfigType =="Integer"){
                    #<input type="number"  />#
                    }#
          </li>
  </script>
<script>
            $(function () {
                // create a template using the above definition    #: Caption #
                var template = kendo.template($("#template").html());

                var dataSource = new kendo.data.DataSource({
                    transport: {
                        // specify the XML file to read. The same as read: { url: "books.xml" }
                        read: {
                            url: "http://41.74.247.118/3GS_API/appapi.svc/uitemplatefields/2120b826-8db8-435c-97db-a1a753fc3e1a",
                            dataType: "json"
                        },
                        
                    },
                    schema: {
                        model: {
                            fields: {
                                IdEditConfig: { type: "string" },
                                Caption: { type: "string" },
                                EditConfigType: { type: "string" },
                                Required: { type: "number" },
                            }
                        }
                    },
                    change:
                        function (e) {
                        $("#books").html(kendo.render(template, this.view()));
                    }
                });

                dataSource.read();
                dataSource.fetch(function () {
                    var data = this.data();
                    console.log(data[0].IdEditConfig + " | " + data[0].Caption + " | " + data[0].EditConfigType + " | " + data[0].Required + " | ");
                });
            });
        </script>

please help! Thanks!

2 Answers, 1 is accepted

Sort by
0
Jose
Top achievements
Rank 1
answered on 20 Mar 2014, 03:15 PM
Found the bug, there was a DatePicker instruction breaking the code for mobile. Is DatePicker not usable with android mobile?
0
Petyo
Telerik team
answered on 24 Mar 2014, 07:51 AM
Hi Jose,

The DatePicker works fine on android - however, the widget itself is not part of the Kendo UI Mobile bundle - you need to use the Kendo UI Complete file kendo.all.min.js.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Templates
Asked by
Jose
Top achievements
Rank 1
Answers by
Jose
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or