Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No matching records found in DataTable

I am using DataTable for retrieving the data from server side. Here. NO information on DataTable. It shows No matching records found error.

Here, oLanguage.sEmptyTable is not working and oLanguage.sZeroRecords is working refer http://datatables.net/ref#sZeroRecords

var DataTableApp = $('#DataTableApp').dataTable({
    "sAjaxSource": "php/getAppDetails.php",
    "bRetrieve":true,
    "bDestroy":true,
    "bServerSide": true,
    //"bProcessing": true,
    "sAjaxDataProp": "aaData",
    //"bDeferRender": true,
    "sServerMethod": "POST",
    "iTotalDisplayRecords":1,
    "iTotalRecords":1,
    "oLanguage": {
      "sZeroRecords": "No records to displays"
    },


    "fnServerParams": function ( aoData ) {
        var imei_app = document.getElementById('imei').value;
        console.log(imei_app);
        aoData.push({"name":"imei","value":imei_app});
    },
    //aoColumns
    "aoColumns": [{
        "mData": "appName"
    }, {
        "mData": "appId"
    }, {
        "mData": "versionInstalled"
    }, {
        "mData": "appSize"
    }, {
        "mData":"dataSize"
    },{
        "mData": "appType"
    },{
        "mData":"installedLocation"
    },{
        "mData": "installedTime"
    }]
});
like image 247
Mohaideen Avatar asked Apr 10 '14 05:04

Mohaideen


1 Answers

oLanguage.sEmptyTable and oLanguage.sZeroRecords (or in the latest format language.emptyTable and language.zeroRecords) have different purposes.

  • language.emptyTable Displays when the table contains no rows at all.
  • language.zeroRecords Displays when, after applying filters, there are now no records to display.

It sounds like your table had rows before filters were applied.

like image 147
AntonChanning Avatar answered Nov 17 '22 19:11

AntonChanning