Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "_fnCreateDragNode": function ()
- {
- var scrolling = this.s.dt.oScroll.sX !== "" || this.s.dt.oScroll.sY !== "";
- var origCell = this.s.dt.aoColumns[ this.s.mouse.targetIndex ].nTh;
- var origTr = origCell.parentNode;
- var origThead = origTr.parentNode;
- var origTbody = origThead.nextElementSibling; // NEW CODE
- var origTable = origThead.parentNode;
- var cloneCell = $(origCell).clone();
- var columnIndex = $(origCell).index(); // NEW CODE
- // NEW CODE START
- var newTbody = $(origTbody.cloneNode(false));
- Array.prototype.forEach.call(origTbody.children, function(origTbodyTr, i) {
- newTbody.append($(origTbodyTr.cloneNode(false)).append(
- $(origTbodyTr.children[columnIndex]).clone()[0]
- ));
- });
- // NEW CODE END
- // This is a slightly odd combination of jQuery and DOM, but it is the
- // fastest and least resource intensive way I could think of cloning
- // the table with just a single header cell in it.
- this.dom.drag = $(origTable.cloneNode(false))
- .addClass( 'DTCR_clonedTable' )
- .append(
- $(origThead.cloneNode(false)).append(
- $(origTr.cloneNode(false)).append(
- cloneCell[0]
- )
- )
- ).append( // NEW CODE
- newTbody // NEW CODE
- ).css( {
- position: 'absolute',
- top: 0,
- left: 0,
- width: $(origCell).outerWidth()
- // REMOVED HEIGHT SETTING
- } )
- .appendTo( 'body' );
- this.dom.pointer = $('<div></div>')
- .addClass( 'DTCR_pointer' )
- .css( {
- position: 'absolute',
- top: scrolling ?
- $('div.dataTables_scroll', this.s.dt.nTableWrapper).offset().top :
- $(this.s.dt.nTable).offset().top,
- height : scrolling ?
- $('div.dataTables_scroll', this.s.dt.nTableWrapper).height() :
- $(this.s.dt.nTable).height()
- } )
- .appendTo( 'body' );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement