Skip to content

Instantly share code, notes, and snippets.

@jonathanread
Created April 7, 2014 16:12
Show Gist options
  • Save jonathanread/ec63fa613dfda6e15265 to your computer and use it in GitHub Desktop.
Save jonathanread/ec63fa613dfda6e15265 to your computer and use it in GitHub Desktop.
function filterList(item) {
var filter = $(item).text().toLowerCase().trim();
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "/finished-work/getall/",
dataType: "json",
cache: true
}
},
pageSize: @ViewData["ItemsPerPage"]
});
if (filter !== "") {
filter = encodeURI(filter);
if (filter !== "all") {
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "/finished-work/get/" + filter,
dataType: "json",
cache: true
}
},
pageSize: @ViewData["ItemsPerPage"]
});
}
}
dataSource.bind("requestEnd", dataSource_RequestEnd);
list.data("kendoListView").setDataSource(dataSource);
$("#pager").kendoPager({
dataSource: dataSource,
info: false,
previousNext: false
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment