I am trying to select all checkboxes on a page once the \'select all\' checkbox is clicked and i am using jquery for this as you can see at the below link:
http://js
You can simply add the handle function to the click event on the select all checkbox:
$('#chk-all-items').click(selectAll);
And then this function should be enough to select all or unselect all.
selectAll = function (event) {
var self = this;
$('.template-item-select').each(function () {
this.checked = self.checked;
});
}