3

My problem is that I have a datatable containing thousands of datas and I faced performance problems on Internet Explorer 11 (I don't want <11 and I'm not facing any issues on Firefox and Chrome). To solve the performance problem I added deferRender: true to my dataTable which was really successful but then I faced another problem I don't have solved yet.

The new problem is that each row of my table has a checkbox and the datatable header has a checkbox which check/uncheck all row checkboxes when there is a click on it. When the click happen I retrieve all nodes in my table by doing var allNodes = myTable.rows().nodes() and change the checked property of each row checkbox.

Without the deferRender option I was retrieving all nodes but since I had this option which is doing a lazy loading I am only retrieving nodes already loaded (first page and pages loaded).

So my question is : Is there a way to keep the IE performance patch with the lazy loading deferRender option and still have access to all nodes (maybe through a function I haven't find yet) or is there another way to improve performance on IE ?

Thank you for your help.

P.S. : If needed I add my datatable initialization code here :

$('#myTable').DataTable({
        ajax: {
            url: myUrl,
            contentType: 'application/json',
            type: 'POST',
            data: function (d) {
                return JSON.stringify(dataToSend);
            }
        },
        columns: [
            {
                data: 'Identifier',
                type: 'html',
                sortable: false,
                render: function (data, type, row) {
                    return '<input type="checkbox" name="checkboxRow" value="' + $('<div/>').text(data).html() + '">';
                }
            },
            {
                data: 'Mnemo',
                render: function (data, type, row) {
                    return '<a class="hand-cursor">' + $('<div/>').text(data).html() + '</a>';
                    }
            },
            { data: 'FamGam.Family' },
            { data: 'FamGam.Gamme' },
            {
                fnCreatedCell: function (nTd, oData, iRow, iCol) {
                    if (oData === 'En service') {
                        $(nTd).addClass('cell-text-green');
                    } else if (oData === 'En cours de démontage') {
                        $(nTd).addClass('cell-text-orange');
                    }
                },
                data: 'dataState.Libelle'
            },
            { data: 'IdentifierUI' },
            { data: 'TechnicalRoom.InterventionUnitySenderSite' },
            { data: 'IdentifierTechnicalRoom' },
            {
                type: 'html',
                sortable: false,
                defaultContent: '<img class="imgBtn secondBtn" ' +
                                     'src="' + urlImages + '/edit.png" ' +
                                     'alt="Editer" title="Editer" />'
            }
        ],
        deferRender: true,
        destroy: true,
        searching: true,
        retrieve: true,
        order: [1, 'asc']
});
dtlvd
  • 503
  • 1
  • 7
  • 21

0 Answers0