Quantcast
Viewing all articles
Browse latest Browse all 82155

add a node "nFilter" to oSettings (for the filter area)

I use the filter area constantly, usually without enabling the "f" setting (e.g. I roll my own). An nFilter node would simplify my code. Also great would be enabling the creation of the filter area without an auto-filter box.

Here's my workaround, if you're interested:

$.fn.dataTableExt.oApi.fnGetFilterArea = function (oSettings) {
    var oFilters = $(oSettings.nTableWrapper).children("." + oSettings.oClasses.sFilter);

    if (oFilters.length === 0) {
        var nFilter = $("<div />", {
            'class': oSettings.oClasses.sFilter,
            'id': oSettings.sTableId + '_filter'
        }).prependTo(oSettings.nTableWrapper);

        return nFilter[0];
    } else {
        return oFilters[0];
    }
}

Viewing all articles
Browse latest Browse all 82155

Trending Articles