Skip to main content

Posts

Showing posts from April, 2015

Bootstrap Server Side Sorting Cont....

On my previous postI had already mentioned about how to apply the sort to Bootstrap paginated tables. By making the following changes server side sorting can be achieved along with pagination.
On Filter Modelself.sortBy = ko.observable('Id');//Default sort Column self.sortAscending = ko.observable(false); self.iconType = ko.observable('glyphicon glyphicon-chevron-down'); // Icon to appear near Column

No Changes to Adarsh Log Model or Adarsh Log list Model
Knockout.js View Model for Adarsh Log Changes Add the sortTable  method to it
self.sortTable = function (viewModel, e) { var columClicked = $(e.target).attr("data-column") var sortAscending = (self.filter().sortAscending() === true) ? false : true;             self.filter().sortAscending(sortAscending);             self.filter().sortBy(columClicked);             datacontext.getAllPost(self.adarshLogListModel, config.adarshLogUrl, model.adarshLogListModel, self.filter).always(function () { var list = []; if (self.filter()…