1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-11-29 11:24:10 +01:00

Dev fix: _pluck should check that what is is accessing exists

- When using _pluck with deferred rendering, there were a number of
  errors due to the nTr element being undefined (that's what deferred
  rendering is all about of course). So the logic to check that pluck
  can pluck from a source object needs ot be added.
This commit is contained in:
Allan Jardine 2013-06-19 16:44:38 +01:00
parent 0142172027
commit 0d8282c61a

View File

@ -9,14 +9,18 @@ var _pluck = function ( a, prop, prop2 ) {
// is essential here
if ( prop2 !== undefined ) {
for ( ; i<ien ; i++ ) {
if ( a[i] && a[i][ prop ] ) {
out.push( a[i][ prop ][ prop2 ] );
}
}
}
else {
for ( ; i<ien ; i++ ) {
if ( a[i] ) {
out.push( a[i][ prop ] );
}
}
}
return out;
};