mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-30 23:52:11 +01:00
Fix: When calculating the string width for column sizes, we know that we are going to be using strings for the display - so cast as a string, which means that we can take the length of any primitive (particularly numbers).
Fix: The max string width calculation was including HTML, which is just plain wrong since the HTML will be hidden. This is still not perfect since "iiii" takes less space than "mmm" in the browser display, but addressing that would take some serious clocks cycles, and this is good enough for now.
This commit is contained in:
parent
dd0e4023f0
commit
fcc41bc535
5
media/js/jquery.dataTables.js
vendored
5
media/js/jquery.dataTables.js
vendored
@ -5685,8 +5685,9 @@
|
||||
|
||||
for ( var i=0 ; i<oSettings.aoData.length ; i++ )
|
||||
{
|
||||
var s = _fnGetCellData( oSettings, i, iCol, 'display' );
|
||||
if ( typeof s == 'string' && s.length > iMax )
|
||||
var s = _fnGetCellData( oSettings, i, iCol, 'display' )+"";
|
||||
s = s.replace( /<.*?>/g, "" );
|
||||
if ( s.length > iMax )
|
||||
{
|
||||
iMax = s.length;
|
||||
iMaxIndex = i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user