Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35270

jQuery object, returned by to$() API, is not fully functional

$
0
0

I assume that myTable.row(index).to$() returns <tr> node wrapped into jQuery object. This is partially true, as one can call myTable.row(index).to$().addClass('selected'), but that fails in following scenario my top = myTable.row(index).to$().position().top.

In jQuery code of position() function

position: function() {
  elem = this[ 0 ];
  if ( jQuery.css( elem, "position" ) === "fixed" ) { ... }
}

the variable elem is initialized with array [ 0 ] which is not DOM element at all. The same affects toJQuery() which is alias for to$().

Workaround: use row().node()

$(myTable.row(index).node()).position()


Viewing all articles
Browse latest Browse all 35270

Trending Articles