Skip to content

Commit

Permalink
Fixed 'select all' checkbox in p:datatable
Browse files Browse the repository at this point in the history
  • Loading branch information
chkal committed Oct 22, 2010
1 parent 2a8706d commit 8775566
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -543,14 +543,15 @@ PrimeFaces.widget.DataTable.prototype.toggleCheckAll = function(element) {
if(checked) {
jQuery(this.jqId + ' .ui-datatable-data td.ui-selection-column input:checkbox').attr('checked', true);

var _self = this;
if(this.getPaginator() != null) {
for(var i=0; i < this.getPaginator().getTotalRecords(); i++) {
this.selection.push(i);
}

} else {
jQuery(this.jqId + ' .ui-datatable-data tr').each(function() {
this.selection.push(jQuery(this).attr('id').split('_row_')[1]);
_self.selection.push(jQuery(this).attr('id').split('_row_')[1]);
});
}

Expand Down

0 comments on commit 8775566

Please sign in to comment.