fixed print table - remove zero value columns but maintain their sequence
This commit is contained in:
parent
ff6f014f29
commit
dee3f48ed7
1 changed files with 10 additions and 3 deletions
|
|
@ -78,9 +78,16 @@ wn.print.Table = Class.extend({
|
|||
});
|
||||
});
|
||||
|
||||
this.columns = cols_with_value;
|
||||
if(this.widths) this.widths = widths;
|
||||
if(this.head_labels) this.head_labels = head_labels;
|
||||
// remove empty cols, widths and head labels
|
||||
this.columns = $.map(this.columns, function(fieldname, i) {
|
||||
if(cols_with_value.indexOf(fieldname)===-1) {
|
||||
if(this.widths) this.widths.splice(i, 1);
|
||||
if(this.head_labels) this.head_labels.splice(i, 1);
|
||||
return null;
|
||||
} else {
|
||||
return fieldname;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
make: function() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue