I am attempting to write an app via Titanium and implementing the Kendo UI. It took me a few days to find the right combination of JavaScript libraries, but I finally got it working. I've now moved onto attempting to get data (into a ListView to start). The following code snippets do work on iOS with the same setup, so it may have something to do with Android's, but I would appreciate any pointers to something I may be missing:
The HTML file looks like:
The JSON Array of data is received in a call back from the Titanium framework to the HTML page where it hands off data from the database.
As I said, this all seems to come through just fine when I load it up on iOS, but in the Android WebView, I get the following JavaScript:
It seems like it can't locate the title attribute of the JSON array, but I don't see any reason why it wouldn't. Has anyone else run into this? Any suggestions from the Kendo folks?
Thanks!
The HTML file looks like:
<
html
>
<
head
>
<!-- Style sheets -->
<
link
href
=
"../css/kendo.mobile.all.css"
rel
=
"stylesheet"
/>
<!-- Javascript libraries -->
<
script
src
=
"../js/jquery-1.7.1.js"
type
=
"text/javascript"
></
script
>
<
script
src
=
"../kendo/kendo.all.min.js"
type
=
"text/javascript"
></
script
>
</
head
>
<
body
>
<
div
data-role
=
"view"
id
=
"content-options"
data-title
=
"Data View 1"
>
<
header
data-role
=
"header"
>
<
div
data-role
=
"navbar"
>
<
span
data-role
=
"view-title"
>Header</
span
>
</
div
>
</
header
>
<
div
id
=
"header-info"
>
<
img
src
=
"../images/img-142.jpg"
alt
=
"img"
/>
<
div
class
=
"version"
>Some text</
div
>
<
div
class
=
"release-date"
>XX/XX/XXXX</
div
>
</
div
>
<
ul
data-role
=
"listview"
id
=
"package-list"
data-style
=
"inset"
>
</
ul
>
</
div
>
<
script
>
var app = new kendo.mobile.Application(document.body, {layout: "default"});
</
script
>
</
body
>
</
html
>
The JSON Array of data is received in a call back from the Titanium framework to the HTML page where it hands off data from the database.
<script>
Ti.App.addEventListener(
'packageDataResponse'
,
function
(responseData) {
var
dataSource =
new
kendo.data.DataSource({
data: responseData.message
});
$(
"#package-list"
).kendoMobileListView({
template:
"${title}"
,
dataSource: dataSource
});
});
</script>
responseData.message = [
{ packageid:
"1"
, title:
"Package 1"
, description:
"Description for Package 1"
},
{ packageid:
"2"
, title:
"Package 2"
, description:
"Description for Package 2"
},
{ packageid:
"3"
, title:
"Package 3"
, description:
"Description for Package 3"
},
{ packageid:
"4"
, title:
"Package 4"
, description:
"Description for Package 4"
}
];
As I said, this all seems to come through just fine when I load it up on iOS, but in the Android WebView, I get the following JavaScript:
Uncaught ReferenceError: title is not defined (2:file:
///android_asset/Resources/HTML/en/index.html)
Thanks!