DataTable shows "No data available in table " before Ajax call made in document.ready()

DataTable shows "No data available in table " before Ajax call made in document.ready()

VadivelVadivel Posts: 10Questions: 1Answers: 0
edited August 2013 in DataTables 1.9
Hello friends,
i m new to data table, i have a following issue in my data table

my data table shows "No data available in table " before Ajax call made in document.ready function. In my page i just loading droplist before document ready() and getting that value as ajax call request parameter.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    It should show "Loading...". Can you link to a test case please?

    Allan
  • VadivelVadivel Posts: 10Questions: 1Answers: 0
    hi allan , thank u for ur response..still i have the same problem, the actual problem is loading morethan 20000 or above records in data table it shows "No data available in table " for some seconds after that only data table loaded..

    Following is my sample code to load data table in document ready:
    oTable = $('#opportunityData').dataTable
    ( {
    "sScrollY": 425,
    "bFilter":true,
    "sDom": 'rt<"bottom"lip><"clear">',

    "bProcessing": true,
    "bDestroy": true,
    "sAjaxSource":appPath+"data/opportunity/search.html",
    "fnServerParams": function ( aoData ) {
    aoData.push( { "name": "resultsql", "value":resultsql} );
    aoData.push( { "name": "jobdept", "value":jobdept} );
    aoData.push( { "name": "edulevel", "value":edulevel} );
    aoData.push( { "name": "explevel", "value":explevel} );
    aoData.push( { "name": "Statedes", "value":statecode} );
    aoData.push( { "name": "currentdistrict", "value":districtcode} );
    aoData.push( { "name": "instname", "value":instName} );
    },
    "fnInitComplete": function() {


    $('.dataTables_scroll').find('.dataTables_scrollBody').niceScroll({


    cursorborder: 'none',

    cursorcolor:"#CCCCCC",
    autohidemode: false


    });
    // custom scroll bars
    // $('.dataTables_scroll').find('.dataTables_scrollBody').mCustomScrollbar({
    // scrollButtons:{
    // enable:true
    // }
    //});
    $('.dataTables_scrollHeadInner').css("width","100%");
    $('.display').css("width","100%");
    $("select").addClass("chzn-select-no-single");
    // $("select").addClass("chzn-select");


    $(".chzn-select-no-single").trigger("liszt:updated");
    var config = {
    '.chzn-select' : {},
    '.chzn-select-deselect' : {allow_single_deselect:true},
    '.chzn-select-no-single' : {disable_search_threshold:10},
    '.chzn-select-no-results': {no_results_text:'Oops, nothing found!'},
    '.chzn-select-width' : {width:"95%"}
    }
    for (var selector in config) {
    $(selector).chosen(config[selector]);
    }

    } ,

    "sPaginationType": "full_numbers",
    "bJQueryUI": true,
    "aoColumnDefs": [

    { "bSearchable": true, "bVisible": false, "aTargets": [8] }
    ],
    // "sDom": 'T<"clear">lrtip',/*Task ID : SF00004*/
    "oTableTools": {/*Task ID : SF00004*/
    "sSwfPath": appPath+"resources/js/copy_csv_xls_pdf.swf",
    "aButtons": [
    {
    "sExtends": "pdf",
    "sButtonText": "Export as PDF",
    //"sPdfMessage": "22/07/2013",

    "mColumns": [0, 1, 2, 3, 4, 5, 6, 7]
    },
    {
    "sExtends": "xls",
    "sButtonText": "Export to Excel",

    "mColumns": [0, 1, 2, 3, 4, 5, 6, 7]
    },
    ]
    },
    "oLanguage":
    {
    "sSearch": "Search all columns:"
    },
    "bAutoWidth": false,
    "aoColumns" : [
    { sWidth:"10%", "sClass":"gridwrap" },
    { sWidth: '10%', "sClass":"gridwrap" },
    { sWidth: '10%' , "sClass":"gridwrap"},
    { sWidth: '10%', "sClass":"gridwrap" },
    { sWidth: '10%', "sClass":"gridwrap" },
    { sWidth: '10%', "sClass":"gridwrap" },
    { sWidth: '10%' , "sClass":"gridwrap"},
    { sWidth: '10%', "sClass":"gridwrap" } ,
    { sWidth: '10%', "sClass":"gridwrap" },
    { sWidth: '10%',"sClass":"centeralign" }

    ]

    } );
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Can you please link to a test page so I can see the issue.

    Allan
This discussion has been closed.