data tables are taking so much time,and finally displaying nothing for get request

data tables are taking so much time,and finally displaying nothing for get request

rameshHolyrameshHoly Posts: 1Questions: 1Answers: 0

myDbTable = $("#myData").DataTable({
// code to show col expansion
"fnDrawCallback": function ( oSettings ) {
$('table[id ="myData"] thead th img').click(function(event){
var tempIndxArr = new Array();
var tempIndxArr_count = 0;
var selectdDivId = $(this).attr("id");
alert("selectdDivId "+selectdDivId);
var mapValuesArr = statusMap[selectdDivId];

                                $(columnArray).each(function(i){
                                    if(i > startCol+1){
                                        var title = $(this).attr("sTitle");
                                        title = title.substring(title.indexOf('<'),title.length);
                                        var divId = $(title).attr("id");
                                        if(divId == selectdDivId){
                                            tempIndxArr[tempIndxArr_count] = i;
                                            tempIndxArr_count = tempIndxArr_count + 1;
                                        }
                                        $(mapValuesArr).each(function(index){
                                            var mapValue = mapValuesArr[index];
                                            if(mapValue == divId){
                                                tempIndxArr[tempIndxArr_count] = i;
                                                tempIndxArr_count = tempIndxArr_count + 1;
                                            }
                                        });
                                        var columnHide = reqDbTable.column( i );
                                        columnHide.visible(false);
                                    }
                                });


                                if(tempIndxArr != null && tempIndxArr.length > 0){
                                    for(var z=0; z < tempIndxArr.length; z++){
                                        var indx = tempIndxArr[z];
                                        var columnShow = reqDbTable.column( indx );
                                        columnShow.visible(true);
                                    }
                                }
                                return false;
                            });

                        },
                        "fnServerParams": function ( aoData ) {

        //Start : To set then parameters for grand total columns
            var bGrandTotalIndexes = '';
            var cnt = 0;
            var cnt1 = 0;
            var grandTotalHeaderColumnIndex = '';
            $(columnArray).each(function(i){
                var bGrandTotal = $(this).attr("bGrandTotal");
                var mDataProp = $(this).attr("mDataProp");
                var bVisible = $(this).attr("bVisible");
                bVisible = ((bVisible == null || bVisible == undefined || (bVisible == true || bVisible == 'true')) ? true : false);
                if(bVisible){
                if(cnt1 == 0){
                    var  tmpMDataPropColIndex = mDataProp.toLowerCase().replace("column","","gi");//column1
                    grandTotalHeaderColumnIndex = tmpMDataPropColIndex;
                    cnt1++;
                }

                bGrandTotal = ((bGrandTotal != null && bGrandTotal != undefined && (bGrandTotal == true || bGrandTotal == 'true')) ? true : false);
                if(bGrandTotal){
                    var  mDataPropColIndex = mDataProp.toLowerCase().replace("column","","gi");//column1
                    if(bGrandTotalIndexes == ''){
                        bGrandTotalIndexes = mDataPropColIndex;
                    }else{
                        bGrandTotalIndexes += ','+mDataPropColIndex;
                    }
                    cnt++;
                }
                }
            });
            if(cnt >0){
                aoData.push( {
                    "name": "sGrandTotalIndexes", 
                    "value": bGrandTotalIndexes
                } );
                aoData.push( {
                    "name": "sGrandTotalHeaderColumnIndex", 
                    "value": grandTotalHeaderColumnIndex
                } );
            }
            //End : To set then parameters for grand total columns
        },



                        "bServerSide": true,
                        "sAjaxSource": "myreqq.do?method=getmyJson&scrNm="+screenName+"&cache
                        "bJQueryUI": true,
                        "sPaginationType": "full_numbers",
                        "bProcessing": true,
                        "iDisplayLength": 10,
                        "bRetrieve": true,
                        "bFilter": true,
                        "aoColumns": columnArray
                    });

Answers

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.

    Information on how to create a test page], if you can't provide a link to your own page can be found here.

    Thanks,
    Allan

This discussion has been closed.