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

DataTables_sort_wrapper being added to columns with bSortable = false;

$
0
0
First of all thanks for making this wonderful tool available!

While working with jQuery Themed table, I noticed that even when specifying bSortable = false in the column, DataTables_sort_wrapper is still being added to the header element. This creates an unnecessary spacing in the header.

The fix is pretty simple, simply skip the column that has bSortable = false
/* Add the extra markup needed by jQuery UI's themes */
			if ( oSettings.bJUI )
			{
				for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
				{
					if (oSettings.aoColumns[i].bSortable  !== false) continue;
					nTh = oSettings.aoColumns[i].nTh;
					
					var nDiv = document.createElement('div');
					nDiv.className = oSettings.oClasses.sSortJUIWrapper;
					$(nTh).contents().appendTo(nDiv);
					
					nDiv.appendChild( document.createElement('span') );
					nTh.appendChild( nDiv );
				}
			}

Viewing all articles
Browse latest Browse all 82001

Trending Articles



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