Problems with sProcessing not showing up

Problems with sProcessing not showing up

mikeandtalishamikeandtalisha Posts: 1Questions: 0Answers: 0
edited February 2012 in General
I have a two datatables on a page and am using server side processing on one of them. I want to show a processing note as the search can be quite lengthy, but I cannot ever get anything to show up at all.

I am using the following:
- Jquery 1.4.3
- Jquery UI 1.8.6
- Datatables 1.8.2

My table definition looks as follows:


$(document).ready(function () {
var searchLocations = $('#SearchTableId').dataTable({
"bJQueryUI": true,
"bAutoWidth": false,
"bServerSide": true,
"bPaginate": false,
"sAjaxSource": "../SearchLocations",
"oLanguage": {
"sProcessing": "Searching...."
},
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [0] },
{ "bVisible": false, "aTargets": [4] },
],
"aaSorting": [[1, "asc"]]
}).fnSetFilteringDelay(500);

var associatedLocations = $('#AssociatedTableId').dataTable({
"bJQueryUI": true,
"bStateSave": false,
"bAutoWidth": false,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [0] },
{ "bVisible": false, "aTargets": [4] },
],
"aaSorting": [[1, "asc"]]
});
});

Replies

  • allanallan Posts: 63,394Questions: 1Answers: 10,450 Site admin
    Hi,

    You need to enable the bProcessing option as well, as this is disabled by default. Just set it to true and that should do it.

    Allan
  • vaibhavt558vaibhavt558 Posts: 3Questions: 0Answers: 0
    Hi Allan
    I am also having problem is displaying a loader on datatable
    I am populating the datatable by array of array of data which is populated on server side and an ajax call is then made to fill up the table, since the server side involves lots of db hits and processing, so it takes time to load the data hence i need to show a loader image while the table is populated.
    Here is what i am doing

    [code]
    $.ajax(
    {
    type : "GET",
    url : "ajaxBacklog",
    contentType : 'application/json',
    data : null,
    dataType : 'json',
    success : function(json)
    {
    oTable = $("#backlogTable").dataTable({
    "aaData" : json.aaData,
    "bProcessing" : true,
    "sPaginationType" : "full_numbers",
    "bJQueryUI" : true,
    "bRetrieve" : true,
    "bPaginate" : true,
    "bStateSave" : true,
    "bSort" : true,
    "aaSorting" : [[ 4, "desc" ]],
    "iDisplayLength" : 50,
    "oLanguage": {
    "sProcessing": "",
    "sEmptyTable": "No records found."
    },
    "aoColumns": [
    { "bSortable": true, sClass: "alignCenter"},
    { sClass: "left"},
    { sClass: "left"},
    { sClass: "left"},
    { sClass:"datecolumn"},
    { sClass: "left"},
    { sClass: "left"},
    ],
    "error": function() {
    alert("Failed to load Data");
    }
    })
    }

    }
    );
    [/code]


    but loader.gif isn't getting displayed. Please tell what m i doing wrong here be it syntactical.
    loader.gif is under webapps folder of the application subdirectory- resources/images
    Help would be appreaciated.
    Thanks
This discussion has been closed.