Hi. I am new with KendoUI and developing a mobile test app. I connect to a website whene i have a PHP page and gets the categories data from Nothwind database. I got an json as thi s:
{"Result":"OK",
"Rows":[
{"CategoryID":1,"CategoryName":"Beverages","NumProducts":12},
{"CategoryID":2,"CategoryName":"Condiments","NumProducts":12},
....
]
}
And html code is :
<script type="text/javascript">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
$.mobile.allowCrossDomainPages = true;
refreshCategoryList();
}
// ----------------------------------------------------------
// Fill Categories List
// ----------------------------------------------------------
function refreshCategoryList() {
var url = 'http://MyServer';
$.getJSON(url, function(res) {
var result = res.Result;
if (result == 'OK') {
var categoryArray = res.Rows;
$("#categoryList").kendoMobileListView({
template : '<li><a href="#proPage" oncclik="sessionStorage.cat=${Rows.CategoryID}">${Rows.categoryName}' +
'<span class="ui-li-count">${Rows..NumProducts}</span></a></li>',
dataSource: kendo.data.DataSource.create( categoryaArray)
});
}
});
}
</script>
</head>
<body>
<ul id="categoryList"></ul>
<script>
window.kendoMobileApplication = new kendo.mobile.Application(document.body);
</script>
But i got this message in teh web console :
E/Web Console(693): TypeError: Result of expression 'd' [undefined] is not an object. at file:///android_asset/www/js/kendo.mobile.min.js:8
Any hint, please...
{"Result":"OK",
"Rows":[
{"CategoryID":1,"CategoryName":"Beverages","NumProducts":12},
{"CategoryID":2,"CategoryName":"Condiments","NumProducts":12},
....
]
}
<script type="text/javascript">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
$.mobile.allowCrossDomainPages = true;
refreshCategoryList();
}
// ----------------------------------------------------------
// Fill Categories List
// ----------------------------------------------------------
function refreshCategoryList() {
var url = 'http://MyServer';
$.getJSON(url, function(res) {
var result = res.Result;
if (result == 'OK') {
var categoryArray = res.Rows;
$("#categoryList").kendoMobileListView({
template : '<li><a href="#proPage" oncclik="sessionStorage.cat=${Rows.CategoryID}">${Rows.categoryName}' +
'<span class="ui-li-count">${Rows..NumProducts}</span></a></li>',
dataSource: kendo.data.DataSource.create( categoryaArray)
});
}
});
}
</script>
</head>
<body>
<ul id="categoryList"></ul>
<script>
window.kendoMobileApplication = new kendo.mobile.Application(document.body);
</script>
But i got this message in teh web console :
E/Web Console(693): TypeError: Result of expression 'd' [undefined] is not an object. at file:///android_asset/www/js/kendo.mobile.min.js:8
Any hint, please...