Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35377

_fnSettingsFromNode issue

$
0
0

It is possible the code base I'm working on has its own subtle issues. However, I've noticed that the line var idx = $.inArray(table, _pluck(_pluck(settings, 'nTable')); in _fnSettingsFromNode fails and returns -1 sometimes. The following alteration fixes the issue:

    function _fnSettingsFromNode ( table )
    {
        var settings = DataTable.settings;
        var idx = $.inArray(table.id, _pluck(_pluck(settings, 'nTable'), 'id')); /* change */
    
        return idx !== -1 ?
            settings[ idx ] :
            null;
    }

It's likely that the table isn't properly in the DOM when we call fnSettingsFromNode since we use jQuery.fn.detach to unload components that aren't being displayed. I'm not sure if it's appropriate to take that into account in the dataTables library, but the solution above seems to work if it is.


Viewing all articles
Browse latest Browse all 35377

Trending Articles