Minor issue/bug in dataTables 2.2.0/2.2.1?
Minor issue/bug in dataTables 2.2.0/2.2.1?
Debugger code (debug.datatables.net):
function dtRowNumber(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$("td:eq(0)", nRow).html(iDisplayIndexFull + 1);
}
var dqThreshold = 50;
function dtCreatedCellPercentComplete(td, cellData, rowData, row, col) {
if (cellData !== '---') {
//alert(Math.abs(numericValue(cellData)) + " > " + (100 - dqThreshold));
if (Math.abs(numericValue(cellData)) == 100) {
$(td).addClass('complete');
}
else if (Math.abs(numericValue(cellData)) < (100 - dqThreshold)) {
$(td).addClass('highlight');
}
}
}
completionTable = $('#tbl-completion').dataTable({
rowCallback : dtRowNumber,
searching : false,
data : [
['1','Yes','ABC','ABC','100.00 %','100.00 %'],
['2','Yes','DEF','DEF','100.00 %','100.00 %']
],
lengthChange : false,
paging : false,
info : false,
order : [ [ 1, "desc" ], [ 2, "asc" ], [ 4, "asc" ] ],
columnDefs : [
{ targets : [ 0 ], className : "no-export" },
{ targets : [ 1 ], className : "centered" },
{ targets : [ 2, 3, 4 ] },
{ targets : [ 5, 6 ], className : "percent", createdCell : dtCreatedCellPercentComplete, type : "num-fmt" },
{ targets : [ 0 ], sortable : false }
]
});
Error messages shown:
Uncaught ResizeObserver loop completed with undelivered notifications.
Description of problem:
While the error above is not a show-stopping error, I do see the datatable resize happening slow in action. I am not sure why though. We don't have any code related to resizing in our application. The stable version where everything related to this datatable looked fine was dataTables 2.1.8. Something must have changed in dataTables 2.2.0 and 2.2.1?
Answers
See this thread discussing the error. The ResizeObserver was added to help with setting the column sizes. See if the nightly version resolves the issue. If not then Allan might ask for a test case to debug further.
Kevin
Forget the "might" - I will as for a test case . The nightly should hopefully resolve the issue and I'd welcome feedback on that. If you are able to confirm the fix, I'll get it packaged up and released.
Allan
Thank you both for the quick response.
Just to be clear, the error doesn't occur on page load, or page reload/refresh etc., The only time I have seen it occur is when I right-click and open the browser debug console. It throws the error and at the same time I see a slow-resizing of the datatable. This behavior is only on Chrome (v132 on my computer). It doesn't occur on Firefox or Edge.
I tried the nightly version and it didn't fix the issue. I still see the error and slow-resizing of my datatable.
test case 1: right-click on the page and select "Inspect". the debug console throws that error as the datatable resizes itself slowly.
test case 2: widen/narrow the browser window and the datatable resizes itself slowly (error shows up in the debug console)
Can you link to the page where this is happening please? Or is it every page which uses DataTables, including the examples on this site?
Allan
I work on a government website. not sure I can share the link publicly. I will have to check with my team on that. the website still uses datatables 2.1.8. we will have to deploy 2.2.1 and once that is done, I could share the link if that is okay?
Yeah no problem. Or if you are able to use JSFiddle, https://live.datatables.net or similar to create a test case showing the issue, that would be fine as well. I just need some way to recreate the issue, and as at the moment I can't see the error. I have seen it in the past, but the work done on it should have resolved it (it does appear to for the test cases I have).
Allan