RepeatHeaders: repeat html content instead of only text

This commit is contained in:
Jan S. (Milania1) 2016-09-06 10:14:00 +02:00
parent 7610c19813
commit 3a5b135fc7
2 changed files with 3 additions and 3 deletions

View File

@ -1,2 +1,2 @@
/*! Widget: repeatHeaders - updated 2/7/2015 (v2.19.0) */
!function(a){"use strict";a.tablesorter.addWidget({id:"repeatHeaders",priority:10,options:{rowsToSkip:4},format:function(b,c,d){var e,f,g,h,i="";if(!d.repeatHeaders){for(i='<tr class="repeated-header '+c.selectorRemove.slice(1)+'">',e=0;e<c.columns;e++)i+="<th>"+a.trim(c.$headers.eq(e).text())+"</th>";d.repeatHeaders=i+"</tr>"}for(h=d&&d.rowsToSkip||4,c.$table.find("tr.repeated-header").remove(),f=c.$tbodies.find("tr"),g=f.length,e=h;e<g;e+=h)f.eq(e).before(d.repeatHeaders)},remove:function(a,b,c){c.repeatHeaders="",b.$table.find("tr.repeated-header").remove()}})}(jQuery);
!function(a){"use strict";a.tablesorter.addWidget({id:"repeatHeaders",priority:10,options:{rowsToSkip:4},format:function(b,c,d){var e,f,g,h,i="";if(!d.repeatHeaders){for(i='<tr class="repeated-header '+c.selectorRemove.slice(1)+'">',e=0;e<c.columns;e++)i+="<th>"+a.trim(c.$headers.eq(e).html())+"</th>";d.repeatHeaders=i+"</tr>"}for(h=d&&d.rowsToSkip||4,c.$table.find("tr.repeated-header").remove(),f=c.$tbodies.find("tr"),g=f.length,e=h;e<g;e+=h)f.eq(e).before(d.repeatHeaders)},remove:function(a,b,c){c.repeatHeaders="",b.$table.find("tr.repeated-header").remove()}})}(jQuery);

View File

@ -19,8 +19,8 @@
if (!wo.repeatHeaders) {
h = '<tr class="repeated-header ' + c.selectorRemove.slice(1) + '">';
for (i = 0; i < c.columns; i++) {
// only get the headerContent text
h += '<th>' + $.trim( c.$headers.eq(i).text() ) + '</th>';
// repeat the content of the current header (including child elements)
h += '<th>' + $.trim( c.$headers.eq(i).html() ) + '</th>';
}
// 'remove-me' class was added in case the table needs to be updated, the 'remove-me' rows will be
// removed prior to the update to prevent including the rows in the update - see 'selectorRemove' option