Hi,
I am using KendoUI version: 2012.3.1315.commercial.
I need help to understand the below code:
i use TabStrip and in my second Tab, i uses ListView to load my data. In the listView, i wanted to call the record as pagination.
I have encounter a very funny behaviour with my code. The LoadMore button when press\click, it just disappear, no event fired to fetch my next record.
Thanks for the advise.
Following are my code:
HTML:
I am using KendoUI version: 2012.3.1315.commercial.
I need help to understand the below code:
i use TabStrip and in my second Tab, i uses ListView to load my data. In the listView, i wanted to call the record as pagination.
I have encounter a very funny behaviour with my code. The LoadMore button when press\click, it just disappear, no event fired to fetch my next record.
Thanks for the advise.
Following are my code:
HTML:
<
div
data-role
=
"view"
data-title
=
"Views"
id
=
"overview-list"
data-init
=
"ProjectList"
data-layout
=
"overview-layout"
>
<
ul
data-role
=
"listview"
data-style
=
"inset"
data-type
=
"group"
>
<
li
>
<
ul
id
=
"endless-scrolling"
>
</
ul
>
</
li
>
</
ul
>
<
script
id
=
"endless-scrolling-template"
type
=
"text/x-kendo-template"
>
<
a
href
=
"/_layouts/projectDetail.aspx?id=#=ID #"
data-transition
=
"slide"
">
<
div
class
=
"Lists"
>
<
img
class
=
"pullImage"
src
=
"#=Picture1 #"
/>#= Title #
<
div
class
=
"metadata"
>
#= Description #
</
div
>
</
div
>
</
a
>
</
script
>
</
div
>
and my Javascript:
$(function () {
window.kendoMobileApplication = new kendo.mobile.Application(document.body);
});
var Skip = 0; //Number of skipped row
var Take = 1; //
function ProjectList() {
var dataSource = new kendo.data.DataSource({
transport: {
read: function (options) {
// make AJAX request to the remote service
$.ajax({
type: "POST",
url: "mobile.aspx/AllProject",
data: "{ Skip:" + Skip + ", Take:" + Take + " }",
contentType: "application/json; charset=utf-8",
dataType: "json",
headers: { "cache-control": "no-cache" },
success: function (data) {
Skip = Skip + Take;
options.success(data.d);
}
});
},
cache: false
},
schema: {
total: function () { return 0; }
}
});
var listMore =$("#endless-scrolling").kendoMobileListView({
dataSource: dataSource,
template: $("#endless-scrolling-template").text(),
loadMore: true
});
}