Pager: update widgets & fire pagerComplete after cache is built

This commit is contained in:
Mottie 2015-02-05 13:06:18 -06:00
parent e42bfdfafa
commit fe81a867fc
4 changed files with 4 additions and 5 deletions

View File

@ -473,7 +473,6 @@
p.last.totalRows = p.totalRows;
p.last.currentFilters = p.currentFilters;
p.last.sortList = (c.sortList || []).join(',');
updatePageDisplay(table, p, true);
$t.trigger('updateCache', [function(){
if (p.initialized) {
// apply widgets after table has rendered & after a delay to prevent
@ -482,6 +481,7 @@
$t
.trigger('applyWidgets')
.trigger('pagerChange', p);
updatePageDisplay(table, p, true);
}, 0);
}
}]);

View File

@ -781,4 +781,3 @@ $.extend($.tablesorter.language, {
</body>
</html>

View File

@ -6282,7 +6282,7 @@ widget.format( table, table.config, table.config.widgetOptions );</pre>
As a full example, say you have a header cell with a class name of <code>"event"</code>. And you want to use the <code>textExtraction</code> function for that column, then you would use this function as follows:
<pre class="prettyprint lang-js">var table = $('table')[0],
textExtractionFunction = $.tablesorter.getColumnData( table, table.config.textExtraction, &quot;.event&quot; );</pre>
The <code>&quot;.event&quot;</code> key can be replaces with a zero-based column index, if the <code>textExtraction</code> option is set up using indexes.
The <code>&quot;.event&quot;</code> key can be replaced with a zero-based column index, if the <code>textExtraction</code> option is set up using indexes.
<p></p>
This function is sometimes used in conjunction with the <code>getData</code> function. This function is called first because the getData function uses the result in the <code>configHeaders</code> parameter - the <code>config.headers</code> option result from this function would be an object and not a function.
</div>

View File

@ -278,9 +278,9 @@ tsp = ts.pager = {
}
tsp.hideRows(table, c);
tsp.changeHeight(table, c);
tsp.updatePageDisplay(table, c);
// make sure widgets are applied - fixes #450
c.$table.trigger('applyWidgets');
tsp.updatePageDisplay(table, c);
})
.on('pageSize.pager refreshComplete.pager', function(e,v){
e.stopPropagation();
@ -708,7 +708,6 @@ tsp = ts.pager = {
p.last.currentFilters = p.currentFilters;
p.last.sortList = (c.sortList || []).join(',');
p.initializing = false;
tsp.updatePageDisplay(table, c);
$t.trigger('updateCache', [function(){
if (p.initialized) {
// apply widgets after table has rendered & after a delay to prevent
@ -717,6 +716,7 @@ tsp = ts.pager = {
$t
.trigger('applyWidgets')
.trigger('pagerChange', p);
tsp.updatePageDisplay(table, c);
}, 0);
}
}]);