_fnProcessingDisplay() displaying only after leaving calling method
_fnProcessingDisplay() displaying only after leaving calling method
mbroadbear
Posts: 1Questions: 0Answers: 0
I have two tables, and I want to transfer selected rows between them. I would like the processing message to appear on both tables until the transfer is complete.
To accomplish this, I created the below 'plugin' method, but the processing messages on the src table does not display until AFTER the method returns, and the processing message on the dest table does not display at all. I have also tried setting css visibility manually (commented out below), but the processing messages also do not display until after the method returns.
What's going on?
[code]
$.fn.dataTableExt.oApi.fnTransferSelectedRows = function(settings, $destTable) {
// $(".dataTables_processing").css('visibility','visible');
this.oApi._fnProcessingDisplay(settings, true);
$destTable.oApi._fnProcessingDisplay(settings, true);
var srcTblInstance = new TableTools(this);
var selectedRows = srcTblInstance.fnGetSelected();
var selectedRowData = srcTblInstance.fnGetSelectedData();
for (i = 0; i < selectedRows.length; i++) {
var deletedRow = this.fnDeleteRow(selectedRows[i], null, false);
}
this.fnDraw(false);
var indexes = $destTable.fnAddData(selectedRowData);
// $(".dataTables_processing").css('visibility','hidden');
// this.oApi._fnProcessingDisplay(settings, false);
// $destTable.oApi._fnProcessingDisplay(settings, false);
}
[/code]
To accomplish this, I created the below 'plugin' method, but the processing messages on the src table does not display until AFTER the method returns, and the processing message on the dest table does not display at all. I have also tried setting css visibility manually (commented out below), but the processing messages also do not display until after the method returns.
What's going on?
[code]
$.fn.dataTableExt.oApi.fnTransferSelectedRows = function(settings, $destTable) {
// $(".dataTables_processing").css('visibility','visible');
this.oApi._fnProcessingDisplay(settings, true);
$destTable.oApi._fnProcessingDisplay(settings, true);
var srcTblInstance = new TableTools(this);
var selectedRows = srcTblInstance.fnGetSelected();
var selectedRowData = srcTblInstance.fnGetSelectedData();
for (i = 0; i < selectedRows.length; i++) {
var deletedRow = this.fnDeleteRow(selectedRows[i], null, false);
}
this.fnDraw(false);
var indexes = $destTable.fnAddData(selectedRowData);
// $(".dataTables_processing").css('visibility','hidden');
// this.oApi._fnProcessingDisplay(settings, false);
// $destTable.oApi._fnProcessingDisplay(settings, false);
}
[/code]
This discussion has been closed.
Replies
Allan