mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Core & editable: ensure table initialized before using updateCell. See #1099
This commit is contained in:
parent
aa79c1d4a1
commit
5494d79953
2
dist/js/widgets/widget-editable.min.js
vendored
2
dist/js/widgets/widget-editable.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1219,6 +1219,12 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
updateCell : function( c, cell, resort, callback ) {
|
updateCell : function( c, cell, resort, callback ) {
|
||||||
|
if ( ts.isEmptyObject( c.cache ) ) {
|
||||||
|
// empty table, do an update instead - fixes #1099
|
||||||
|
ts.updateHeader( c );
|
||||||
|
ts.commonUpdate( c, resort, callback );
|
||||||
|
return;
|
||||||
|
}
|
||||||
c.table.isUpdating = true;
|
c.table.isUpdating = true;
|
||||||
c.$table.find( c.selectorRemove ).remove();
|
c.$table.find( c.selectorRemove ).remove();
|
||||||
// get position from the dom
|
// get position from the dom
|
||||||
|
@ -222,6 +222,8 @@
|
|||||||
.data( 'before', valid )
|
.data( 'before', valid )
|
||||||
.data( 'original', valid )
|
.data( 'original', valid )
|
||||||
.trigger( 'change' );
|
.trigger( 'change' );
|
||||||
|
// prevent error if table was destroyed - see #1099
|
||||||
|
if ( c.table.hasInitialized ) {
|
||||||
$.tablesorter.updateCell( c, $this.closest( 'td' ), false, function() {
|
$.tablesorter.updateCell( c, $this.closest( 'td' ), false, function() {
|
||||||
if ( wo.editable_autoResort ) {
|
if ( wo.editable_autoResort ) {
|
||||||
setTimeout( function() {
|
setTimeout( function() {
|
||||||
@ -233,6 +235,7 @@
|
|||||||
tse.editComplete( c, wo, c.$table.data( 'contentFocused' ) );
|
tse.editComplete( c, wo, c.$table.data( 'contentFocused' ) );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if ( !valid && e.type !== 'keydown' ) {
|
} else if ( !valid && e.type !== 'keydown' ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user