Three side ajax still happening

Three side ajax still happening

amacourekamacourek Posts: 15Questions: 2Answers: 0

According to this thread - https://datatables.net/forums/discussion/71239, this should have been resolved.

I am using the latest version:

I am still seeing three identical calls AJAX when a search is performed. Here is my definition:

var datatable = $('#dataTable')
.DataTable({
responsive: false,
autoWidth: true,
lengthChange: false,
serverSide: true,
scrollX : true,
deferLoading: 0,
dom: 'pQlrtip',
language: {
searchBuilder: {
title: 'Report Builder',
data: 'Column',
add: 'Add Criteria',
condition: 'Criteria'
}
},
searchBuilder: {
liveSearch: false,
preDefined: definition
},
ajax: {
url: '?handler=ListItems',
type: 'POST',
data: function (d) {
d.refreshResults = refreshResults
},
headers: {
RequestVerificationToken:
$('input:hidden[name="__RequestVerificationToken"]').val()
},
beforeSend: function () {
if (!$(".dtsb-search").is(":visible")) return false;

                    if (!isCriteriaValid()){
                        return false;
                    }

                    showLoader();
                },
                complete: function (x) {
                    hideLoader();
                    refreshResults = false;
                },
            },
            "columns": tableColumns,
            pageLength: 25
        })
        .on('search.dt', function () {
            searchPerformed();
        });

Replies

  • amacourekamacourek Posts: 15Questions: 2Answers: 0

    I have determined that the problem occurs only with predefined criteria. I am saving the criteria that was used on the page and when the page loads, I have the criteria preloaded. If you look above, I have preDefined set to a variable. I have the variable defined as:

    var definition = {"logic":"AND","value":[],"criteria":[{"condition":"contains","data":"Name","origData":"name","type":"string","value":["j"]}]};

  • amacourekamacourek Posts: 15Questions: 2Answers: 0

    I did try and load the definition post creation of the table with

    datatable.searchBuilder.rebuild(definition);

    This has the same problem with the multiple ajax calls.

  • allanallan Posts: 63,434Questions: 1Answers: 10,458 Site admin

    Hi,

    Thanks for flagging this up. I've logged this on my bug tracker to take a look at it when the dust from the DT2 release has settled :)

    Allan

  • amacourekamacourek Posts: 15Questions: 2Answers: 0

    I just updated to 1.7 and the multiple ajax seems to be gone.

Sign In or Register to comment.