Created
April 7, 2014 16:12
-
-
Save jonathanread/ec63fa613dfda6e15265 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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