Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81997

Returning a jQuery element from mRender 'display' mode?

$
0
0
Hi, I love the mRender feature.

It seems that it would be convenient if a jQuery element could be returned. That way you can dynamically create an element and load it with click() handlers and data().

I don't know if this is the right place to discuss mods, but perhaps I can get some feedback on this change. I'd fork the project and submit a pull request, but I don't fully understand the packaging system. The main zip download is different from cloning the repo.

Was:
nTd.innerHTML = (typeof oCol.fnRender === 'function' && (!oCol.bUseRendered || oCol.mData === null)) ?
	_fnRender( oSettings, iRow, i ) :
	_fnGetCellData( oSettings, iRow, i, 'display' );

Changed to:

var display_obj = (typeof oCol.fnRender === 'function' && (!oCol.bUseRendered || oCol.mData === null)) ?
	_fnRender( oSettings, iRow, i ) :
	_fnGetCellData( oSettings, iRow, i, 'display' );
if(typeof(display_obj)=="object")
{
  $(nTd).append(display_obj);
} else {
  nTd.innerHTML = display_obj;
}

Viewing all articles
Browse latest Browse all 81997

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>