preXhr doesnt take all the params before it fires

preXhr doesnt take all the params before it fires

shsshs Posts: 3Questions: 2Answers: 0
edited October 2017 in Free community support

hey guys am creating multiple filters that runs on server side processing and am creating array where am storing the filter values but the problem am getting that only first filter fire on preXHR and i want it to store first all filter values to the array and then do preXhr but it doesnt because my first filter fire and prevent the other to do so on first ajax can someone please help me. this is sample of the code:

Answers

  • shsshs Posts: 3Questions: 2Answers: 0
    edited October 2017

    if (oTable.fnSettings().oFeatures.bServerSide == true) {
    console.log('filterdata', filterData);
    var settings = oTable.fnSettings();
    $(oTable[0]).on('preXhr.dt', function ( e, settings, data ) {
    var filter = [];
    Object.keys(filterData).forEach(function(key,index) {
    filter.push({name: key, value: filterData[key]})

                    });
                    $.extend(data, {
                        filter: filter
                    });
        console.log('testdraw', settings.iDraw);
    });
    
This discussion has been closed.