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

Aborting AJAX request seems to prevent the ajax.data function from subsequently being called.

$
0
0

I'm currently using DataTables 1.10.10 and implementing the following approach to add some additional filters to the AJAX request being submitted:

var dtbl = $('#table').DataTable({
    'ajax': {
        'url': '/my/data/endpoint/',
        'data': function(d) {
            d['filters']['someKey'] = 'someValue';
        }
    }
)};

I'm also using the following code to abort a request should my filter params change.

dtbl.on('preXhr', function(evt, settings) {
    if (settings.jqXHR) {
        settings.jqXHR.abort();
    }
})

Both of these are doing what they should, however after aborting an AJAX request the function assigned to ajax.data no longer gets called on subsequent AJAX requests, even though the requests themselves are successful. As a result, my custom filter data is not added to the request.

Has anyone seen this before or have any idea what may be going on? Thanks in advance!


Viewing all articles
Browse latest Browse all 82275

Trending Articles