mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Ensure updateRow & not update is triggered. See issue #217
This commit is contained in:
parent
e3ae84a1e9
commit
c4dceff34e
@ -333,7 +333,7 @@
|
||||
fixHeight(table, p);
|
||||
// apply widgets after table has rendered
|
||||
$t.trigger('applyWidgets');
|
||||
$t.trigger('update', [false, function(){
|
||||
$t.trigger('updateRow', [false, function(){
|
||||
if (p.initialized) {
|
||||
$t.trigger('updateComplete');
|
||||
$t.trigger('pagerChange', p);
|
||||
@ -564,7 +564,7 @@
|
||||
pg.val(p.size); // set page size
|
||||
p.totalPages = Math.ceil( Math.min( p.totalPages, p.filteredPages ) / p.size );
|
||||
if ( triggered ) {
|
||||
$(table).trigger('update');
|
||||
$(table).trigger('updateRow');
|
||||
setPageSize(table, p.size, p);
|
||||
hideRowsSetup(table, p);
|
||||
fixHeight(table, p);
|
||||
|
@ -3243,7 +3243,7 @@ $("table").trigger("sortReset");</pre></div>
|
||||
<tr id="update">
|
||||
<td><a href="#" class="permalink">update</a> / <a href="#" class="permalink">updateRow</a></td>
|
||||
<td>Update the <code>tbody</code>'s stored data (<code>update</code> & <code>updateRow</code> do exactly the same thing)
|
||||
<div class="collapsible">
|
||||
<div class="collapsible"><br>
|
||||
<pre class="prettyprint lang-javascript">// Add new content
|
||||
$("table tbody").append(html);
|
||||
|
||||
@ -3264,7 +3264,9 @@ $("table").trigger("update", [resort, callback]);
|
||||
var sorting = [[2,1],[0,0]];
|
||||
$("table")
|
||||
.trigger("update", [ false ])
|
||||
.trigger("sorton", [sorting]);</pre></div>
|
||||
.trigger("sorton", [sorting]);</pre>
|
||||
Note: <code>updateRow</code> was added to work around the issue of using jQuery with the Prototype library. Triggering an "update" would make Prototype clear the tbody; Please see <a href="https://github.com/Mottie/tablesorter/issues/217">issue #217</a> for more details.
|
||||
</div>
|
||||
</td>
|
||||
<td><a href="example-ajax.html">Example</a></td>
|
||||
</tr>
|
||||
|
@ -519,7 +519,7 @@ tsp = ts.pager = {
|
||||
tsp.fixHeight(table, c);
|
||||
// apply widgets after table has rendered
|
||||
$t.trigger('applyWidgets');
|
||||
$t.trigger('update', [false, function(){
|
||||
$t.trigger('updateRow', [false, function(){
|
||||
if (p.initialized) {
|
||||
$t.trigger('updateComplete');
|
||||
$t.trigger('pagerChange', c);
|
||||
@ -762,7 +762,7 @@ tsp = ts.pager = {
|
||||
p.totalPages = Math.ceil( Math.min( p.totalPages, p.filteredPages ) / p.size );
|
||||
c.$table.removeClass('pagerDisabled');
|
||||
if ( triggered ) {
|
||||
c.$table.trigger('update');
|
||||
c.$table.trigger('updateRow');
|
||||
tsp.setPageSize(table, p.size, c);
|
||||
tsp.hideRowsSetup(table, c);
|
||||
tsp.fixHeight(table, c);
|
||||
|
Loading…
Reference in New Issue
Block a user