bProcessing - what am I missing?

bProcessing - what am I missing?

ErikSErikS Posts: 16Questions: 0Answers: 0
edited July 2012 in General
I am trying to add bProcessing to my code, but it does not appear to be working. Here is my code. I saw something about a css entry for the table, but did not understand what it was referring to. It implied something like this:
#assignment_table_processing
{ background-color: #FF0000; }

[code]
jQuery(document).ready( function () {

var oTable = jQuery('#assignment_table').dataTable({
"bProcessing": true,
"bStateSave": true,
"oLanguage": {
"sZeroRecords": "No results"
},
"fnDrawCallback": function ( oSettings ) {
/* Need to redo the counters if filtered or sorted */
if ( oSettings.bSorted || oSettings.bFiltered )
{
for ( var i=0, iLen=oSettings.aiDisplay.length ; i,
"iDisplayLength": <%=itemsPerPage%>,
"sDom": 'iplrtp<"clear">',
"sPaginationType": "full_numbers",
"aaSorting": [[ <%=sortColumn%>, "<%=sortDirection%>" ]],
"aoColumnDefs": [
{"bSortable": false, "aTargets": [0,1,2,3,4]},
{"sType": "uniDate", "aTargets": ["date"]},
{"sType": "html", "aTargets": ["htmldiv"]},
{"sType": "numeric", "aTargets": ["number"]}
],
"fnServerData": function (sSource, aoData, fnCallback) {
aoData.push({"name": "layout", "value": "<%=plLayout%>" });
aoData.push({"name": "status", "value": "<%=plStatus%>" });
aoData.push({"name": "cabinet", "value": "<%=plCabinet%>" });
aoData.push({"name": "upload", "value": "<%=plUpload%>" });
aoData.push({"name": "analyst", "value": "<%=plAnalyst%>" });
aoData.push({"name": "work", "value": "<%=plWork%>" });
aoData.push({"name": "column", "value": "<%=plColumn%>" });
aoData.push({"name": "operator", "value": "<%=plOperator%>" });
aoData.push({"name": "criteria", "value": "<%=plCriteria%>" });
aoData.push({"name": "includeAll", "value": "<%=plInclude%>" });
aoData.push({"name": "isAnalyst", "value": "<%=isAnalyst%>" });
aoData.push({"name": "userId", "value": "<%=userIdi%>" });
aoData.push({"name": "userDeptId", "value": "<%=userDeptIdi%>" });

jQuery.ajax({
"dataType": "json",
"type": "POST",
"url": sSource,
"data": aoData,
error: function (jqXHR, textStatus, errorThrown) {
ajaxFailedFunctionToCall = null
//jQuery("#assignment_table_processing").css({visibility: "hidden"});;
alert(jqXHR.status+','+textStatus+','+errorThrown);
},
success: function(data) {
if(data.exportLocation != undefined) {
window.location = data.exportLocation;
}
fnCallback(data);
}
})
}
});
new FixedHeader( oTable, { "zTop": "10" });
// these oSettings lines prevent the initial ajax call, but allow rest of calls to user ajax.
oSettings = oTable.fnSettings();
oSettings.oFeatures.bServerSide = <%=callDbUsingAjax%>;
oSettings.oFeatures.bProcessing = true;
oSettings.sAjaxSource = "/admin/ajax.jsp?action=assignListSort";
});
[/code]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    We would need a link to a test case showing the issue please. As you can see in this example ( http://datatables.net/release-datatables/examples/server_side/server_side.html ) the bProcessing flag should show a "processing" message when data is obtained from the server.

    Allan
  • ErikSErikS Posts: 16Questions: 0Answers: 0
    This is for a closed system, internal network only, so not sure how I would get a test case.
    What I am asking is are there other flags, other pieces - like the css - that jump out as being needed.

    I get the data on open of the page, so I do not want to call the ajax on the document.ready. If the resulting rows returned are not enough to need to revisit the database, i do not want to call the ajax either. I am using callDbUsingAjax as a boolean to determine if we want to make the ajax call and do the serverside processing.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > What I am asking is are there other flags, other pieces - like the css - that jump out as being needed.

    Not that I see. You could try adding a little bit of debug code to DataTables to check that it is being made visible: _fnProcessingDisplay is the inter nation function where you would want to add a bit of debug.

    Allan
  • ErikSErikS Posts: 16Questions: 0Answers: 0
    So, mysteriously, the processing box showed up in production this morning. The plug-in file uniDate.js had been deleted by a replication process. When it was re added, the box went away. Off to figure out how these might be interrelated. I'll post back with what I find.
This discussion has been closed.