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

aoServerParams - Access oSettings inside the fn function

$
0
0
Hello community

I'm working on some kind of an filter plugin which allows to specify several search boxes on top of the datatables table.
Thanks to aoServerParams, I can push a function which then will pass the content of the added textboxes to the ajax request. Or this is how I thought I can achieve it. There is one problem:

How can I access the oSettings object from within to fn function?
Because there would be the number of textboxes, which I need to iterate in order to pass their value to aoData

        (function (window, document, $, undefined) {
            $.fn.dataTable.AdvancedFilter = function (oSettings) {
                [...]
                oSettings.aoServerParams.push({
                    "sName": "advancedFilter",
                    "fn": function (aoData) {
                        aoData.push({
                            "name": "...",
                            "value": "..."
                        });
                    }
            });
        })(window, document, jQuery);

Or is there even a better approach for what I'd like to achieve?

Best regards

Samuel

Viewing all articles
Browse latest Browse all 82801

Trending Articles



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