Greetings, I have a question regarding the remote datasource with server paging. My attempts were not entirely successful so please shed some light on what I was doing wrong.
Basically I have a template that sets up the search result view that contains a listview as its content. The listview is set up via the template. I have a search button that creates the datasource that the listview reads from, and then navigate to the search result view.
On chrome it seems to be working ok but when I load it on a device with cordova, it throws an error saying 'undefined' is not an object evaluating makeVirtual. The only problem I noticed is that sometimes the items in the listview is not laid out properly on the first show. Maybe this has something to do with the problem I’m having?
Here is my code:
//this is actually assigned globally
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: window.webserviceUrl + "/Search",
dataType: "xml"
},
parameterMap: function(data, type) {
return String.format("categoryId={0}&place={1}&keywords={2}&countryName={3}&page={4}&pageSize={5}",
dataItem.id,
place,
keywords,
"Australia",
data.page,
pageSize);
}
},
schema: {
type: "xml",
data: "/Products/product",
model: {
fields: {
id: "id/text()",
name: "name/text()",
highlight: "highlight/text()"
}
}
},
change: function(e) {
AW5.app.hideLoading();
},
pageSize: pageSize,
serverPaging: true
});
if ($("#product-list-1 .product-list").data("kendoMobileListView")) {
$("#product-list-1 .product-list").data("kendoMobileListView").setDataSource(ds);
}
AW5.app.navigate("#product-list-1");
///Template
<!-- Category product list view -->
<div id="product-list-#= instance #" data-role="view" class="member-only" data-module-instance="#= instance #" data-use-native-scrolling="true">
<header data-role="header">
<div data-role="navbar">
<a class="nav-button" data-align="left" data-role="backbutton"></a>
<span data-role="view-title">Search results</span>
</div>
</header>
<ul class="product-list" data-source="ds (globally set)" data-role="listview" data-template="product-template" data-click="products.click" data-endless-scroll="true">
</ul>
</div>
Basically I have a template that sets up the search result view that contains a listview as its content. The listview is set up via the template. I have a search button that creates the datasource that the listview reads from, and then navigate to the search result view.
On chrome it seems to be working ok but when I load it on a device with cordova, it throws an error saying 'undefined' is not an object evaluating makeVirtual. The only problem I noticed is that sometimes the items in the listview is not laid out properly on the first show. Maybe this has something to do with the problem I’m having?
Here is my code:
//this is actually assigned globally
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: window.webserviceUrl + "/Search",
dataType: "xml"
},
parameterMap: function(data, type) {
return String.format("categoryId={0}&place={1}&keywords={2}&countryName={3}&page={4}&pageSize={5}",
dataItem.id,
place,
keywords,
"Australia",
data.page,
pageSize);
}
},
schema: {
type: "xml",
data: "/Products/product",
model: {
fields: {
id: "id/text()",
name: "name/text()",
highlight: "highlight/text()"
}
}
},
change: function(e) {
AW5.app.hideLoading();
},
pageSize: pageSize,
serverPaging: true
});
if ($("#product-list-1 .product-list").data("kendoMobileListView")) {
$("#product-list-1 .product-list").data("kendoMobileListView").setDataSource(ds);
}
AW5.app.navigate("#product-list-1");
///Template
<!-- Category product list view -->
<div id="product-list-#= instance #" data-role="view" class="member-only" data-module-instance="#= instance #" data-use-native-scrolling="true">
<header data-role="header">
<div data-role="navbar">
<a class="nav-button" data-align="left" data-role="backbutton"></a>
<span data-role="view-title">Search results</span>
</div>
</header>
<ul class="product-list" data-source="ds (globally set)" data-role="listview" data-template="product-template" data-click="products.click" data-endless-scroll="true">
</ul>
</div>