or
<
div
id
=
"test-view"
data-role
=
"view"
data-title
=
"Test"
data-layout
=
"default-layout"
data-init
=
"app.test.init"
data-show
=
"app.test.showView"
>
<
ul
id
=
"test-list"
class
=
"ul-content"
data-role
=
"listview"
>
</
ul
>
</
div
>
<
script
type
=
"text/x-kendo-tmpl"
id
=
"endless-scrolling-template"
>
<
li
>#: name#</
li
>
</
script
>
(
function
(global) {
var
app = global.app = global.app || {};
app.test = {
init:
function
(e) {
$(
"#test-view ul#test-list"
).kendoMobileListView({
dataSource:
new
kendo.data.DataSource({
type:
"json"
,
serverPaging:
true
,
pageSize: 50,
transport: {
read: {
dataType:
"json"
}
},
schema: {
type:
"json"
,
data:
function
(data) {
return
data.result;
},
total:
function
(data) {
return
data.total;
}
}
}),
template: $(
"#endless-scrolling-template"
).text(),
endlessScroll:
true
});
},
showView:
function
(e) {
$(
"#loading-overlay"
).show();
app.application.showLoading();
setTimeout(
function
() {
$(
"#loading-overlay"
).hide();
app.application.hideLoading();
}, 2000);
e.view.scroller.reset();
}
};
})(window);
{
"result"
:[{
"name"
:
"Item 1"
},{
"name"
:
"Item 2"
},{
"name"
:
"Item 3"
},{
"name"
:
"Item 4"
},{
"name"
:
"Item 5"
},{
"name"
:
"Item 6"
},{
"name"
:
"Item 7"
},{
"name"
:
"Item 8"
}],
"total"
:8}
{
"filters":[
{
"field":"username",
"operator":"contains",
"value":"bob"
},
{
"field":"username",
"operator":"contains",
"value":"john"
}
]
}
.DataSource(ds => ds
.Ajax()
.ServerOperation(
false
)
.Read(r => r.Action(
"_List"
,
"Employee"
).Data(
"SetEmployeeGridData"
))
function SetEmployeeGridData() {
return
{ locationFilter: $(
'#locationFilter'
).val(),
departmentFilter: $(
'#departmentFilter'
).val(),
lastNameFilter: $(
'#lastNameFilter'
).val() };
}
public
ActionResult _List([DataSourceRequest] DataSourceRequest request,
string
locationFilter,
string
departmentFilter,
string
lastNameFilter)
{
$(
'#EmployeeGrid'
).data(
'kendoGrid'
).dataSource.read();