I am struggling here. Using this simple pagination plug (http://flaviusmatis.github.io/simplePagination.js/#page-19) and trying to set the number of items to a value returned from an ajax call. But it will never work. If I set the number of items to a hard coded number it works just fine, but every for every letter I call this function with the number of items will change so I want to do it with this call.
This is what I have:
$(document).ready(function () {
ko.applyBindings(viewModel);
var numNames;
$.ajax({
type: "GET",
url: "/api/Name/GetBoyCount?letter=" + viewModel.Letter(),
complete: function (data) {
$(selector).pagination('updateItems', parseInt(data));
}
});
$(function () {
$(selector).pagination({
items: 100,
itemsOnPage: 175,
cssStyle: 'light-theme'
});
});
// etc