mirror of
https://github.com/DataTables/DataTables.git
synced 2025-03-15 16:29:16 +01:00
New: fnOpen will now take either a node, a jQuery object or a string (which was previously the only option) as it's second parameter, for what to enter into the 'details' row that is created - 2488.
This commit is contained in:
parent
503c3cfca5
commit
71188b18a0
16
media/js/jquery.dataTables.js
vendored
16
media/js/jquery.dataTables.js
vendored
@ -1720,10 +1720,10 @@
|
|||||||
* Purpose: Open a display row (append a row after the row in question)
|
* Purpose: Open a display row (append a row after the row in question)
|
||||||
* Returns: node:nNewRow - the row opened
|
* Returns: node:nNewRow - the row opened
|
||||||
* Inputs: node:nTr - the table row to 'open'
|
* Inputs: node:nTr - the table row to 'open'
|
||||||
* string:sHtml - the HTML to put into the row
|
* string|node|jQuery:mHtml - the HTML to put into the row
|
||||||
* string:sClass - class to give the new TD cell
|
* string:sClass - class to give the new TD cell
|
||||||
*/
|
*/
|
||||||
this.fnOpen = function( nTr, sHtml, sClass )
|
this.fnOpen = function( nTr, mHtml, sClass )
|
||||||
{
|
{
|
||||||
/* Find settings from table node */
|
/* Find settings from table node */
|
||||||
var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
|
var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
|
||||||
@ -1736,8 +1736,16 @@
|
|||||||
nNewRow.appendChild( nNewCell );
|
nNewRow.appendChild( nNewCell );
|
||||||
nNewCell.className = sClass;
|
nNewCell.className = sClass;
|
||||||
nNewCell.colSpan = _fnVisbleColumns( oSettings );
|
nNewCell.colSpan = _fnVisbleColumns( oSettings );
|
||||||
nNewCell.innerHTML = sHtml;
|
|
||||||
|
if( typeof mHtml.jquery != 'undefined' || typeof mHtml == "object" )
|
||||||
|
{
|
||||||
|
nNewCell.appendChild( mHtml );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nNewCell.innerHTML = mHtml;
|
||||||
|
}
|
||||||
|
|
||||||
/* If the nTr isn't on the page at the moment - then we don't insert at the moment */
|
/* If the nTr isn't on the page at the moment - then we don't insert at the moment */
|
||||||
var nTrs = $('tr', oSettings.nTBody);
|
var nTrs = $('tr', oSettings.nTBody);
|
||||||
if ( $.inArray(nTr, nTrs) != -1 )
|
if ( $.inArray(nTr, nTrs) != -1 )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user