javascript - datatables custom filtering - Stack Overflow

I am pretty surprised at how custom filtering works in datatables.It seems like i need to define a glo

I am pretty surprised at how custom filtering works in datatables. It seems like i need to define a global filter function like this:

$.fn.dataTableExt.afnFiltering.push(function (oSettings, aData, iDataIndex) { .. });

and then ALL datatables on my page will use that function to filter. This is not acceptable.

What i need is a way to programmatically filter a datatable using a custom filter function. I would expect this function to take a row and return true/false based on some criteria to show/hide that row from the result.

does a way of doing this exist?

I am pretty surprised at how custom filtering works in datatables. It seems like i need to define a global filter function like this:

$.fn.dataTableExt.afnFiltering.push(function (oSettings, aData, iDataIndex) { .. });

and then ALL datatables on my page will use that function to filter. This is not acceptable.

What i need is a way to programmatically filter a datatable using a custom filter function. I would expect this function to take a row and return true/false based on some criteria to show/hide that row from the result.

does a way of doing this exist?

Share Improve this question asked Aug 30, 2012 at 14:56 mkoryakmkoryak 58k64 gold badges203 silver badges262 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 2

does this link help:

http://datatables/forums/discussion/8435/remove-custom-filtering/p1

/* Custom filtering function which will filter data in column four between two values */
$.fn.dataTableExt.afnFiltering.push(
        function (oSettings, aData, iDataIndex) {
            if ( oSettings.nTable.id === "my_filtering_table" ) {
                var selectCode = document.getElementById('statusSelect').value;
                return filterRow(selectCode, aData);
            }
            else {
                return true;
            }
        }
);

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745652923a4638373.html

相关推荐

  • javascript - datatables custom filtering - Stack Overflow

    I am pretty surprised at how custom filtering works in datatables.It seems like i need to define a glo

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信