Core: prevent addRows error. See #979

This commit is contained in:
Mottie 2015-07-29 18:08:15 -05:00
parent 3cd026ee05
commit 439034aa5e

View File

@ -971,6 +971,13 @@
})
.bind('addRows' + c.namespace, function(e, $row, resort, callback) {
e.stopPropagation();
if ( !$row || !( $row instanceof jQuery ) || $row.closest( 'table' )[ 0 ] !== c.table ) {
if ( c.debug ) {
console.error( 'addRows method requires a jQuery selector reference to rows that have already ' +
'been added to the table' );
}
return false;
}
table.isUpdating = true;
if (isEmptyObject(c.cache)) {
// empty table, do an update instead - fixes #450