Datatable freezes for few seconds

Datatable freezes for few seconds

tarundoluitarundolui Posts: 2Questions: 2Answers: 0

Hi,

I am using jquery layout where I have two datatable in center and south panel. I am loading 200 flights for each data table with fnRowCallback function. But when it starts create the row browser gets freezed. Can someone help me how can I improve the performance. Please see my sample code below:

"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {

        var fltNbr = aData.flt.cellData;
        var orig = aData.orig.cellData;
        var dest = aData.dest.cellData;
        var fltStatus = aData.stat.cellData;

        var statToolTipData = aData.stat.tooltipData;
        var fpWbToolTipData = aData.fpWb.tooltipData;
        var notesTipData = aData.notes.tooltipData;
        var surpToolTipData = aData.surp.tooltipData;
        var crewToolTipData = aData.crew.tooltipData;
        var edueToolTipData = aData.edue.tooltipData;
        var osToolTipData = aData.os.tooltipData;

        $('td:eq(4)', nRow).attr('title', statToolTipData);
        $('td:eq(5)', nRow).attr('title', fpWbToolTipData);
        $('td:eq(6)', nRow).attr('title', notesTipData);
        $('td:eq(16)', nRow).attr('title', surpToolTipData);
        $('td:eq(18)', nRow).attr('title', edueToolTipData);
        $('td:eq(21)', nRow).attr('title', crewToolTipData);
        $('td:eq(24)', nRow).attr('title', osToolTipData);


        var checkBoxValue = "UR_"+iDisplayIndex+"_"+fltNbr+"_"+orig;
        $('td:eq(28)', nRow).html( '<input type="checkbox" name="case1" class="case1" value="'+ checkBoxValue+'">');
        $(nRow).attr('id', checkBoxValue);

        var tempContextMenu = "";
        tempContextMenu = sContextMenu;
        if(fltStatus == 'OFF'){
            tempContextMenu.sendMessage.disabled = true;
        }else
            tempContextMenu.sendMessage.disabled = false;

        bindRightClickMenu(tempContextMenu,checkBoxValue); 


        $(nRow).on('click', function() {

            document.getElementById('qvFlt').innerHTML = aData.flt.cellData;
            document.getElementById('qvOrig').innerHTML = aData.orig.cellData;
            document.getElementById('qvDest').innerHTML = aData.dest.cellData;
            document.getElementById('qvSec').innerHTML = aData.sec.cellData;
            document.getElementById('quick-send-message-dialog-id').innerHTML = 'UAL'+aData.flt.cellData+"-"+aData.orig.cellData;

            var cellIndex = $(this).index();
             if(cellIndex == 1)
             {
                openDialog("send-message-dialog",e.pageX, e.pageY,aData);

             }

        var selRowToChangeColor = $(this);
        changeColorOnRowSelect(selRowToChangeColor);
    });


    $('td', nRow).on('click', function(e) {
     var cellIndex = $(this).index();
     if(cellIndex == 1)
         openDialog("send-message-dialog",e.pageX, e.pageY,aData);
    }); 

    var index = iDisplayIndex +1;
    $('td:eq(0)',nRow).html(index); //row numbering

}
});

This discussion has been closed.