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!
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!