Desactivate warning
Desactivate warning
Hello at everybody,
i would wish desactivate the warning :
[code]
"DataTables warning: Unexpected number of TD elements. Expected 3057 and got 2448. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination."
[/code]
It appears if i go to an another page and in the same time, the datatable isn't fully loaded.
How do you can desactivate the warning ?
I didn't find the option to do this.
An solution is to desactivate every click on the document and re-activate when datatable is fully loaded but i would like something more efficient.
[code]
$(document).click(function() {
alert('datatable is'nt fully loaded');
return(false);
});
$('#my-datatable').dataTable({
.....,
.....,
"fnInitComplete": function() {
$(document).unbind('click');
}
[/code]
Thanks in advance.
i would wish desactivate the warning :
[code]
"DataTables warning: Unexpected number of TD elements. Expected 3057 and got 2448. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination."
[/code]
It appears if i go to an another page and in the same time, the datatable isn't fully loaded.
How do you can desactivate the warning ?
I didn't find the option to do this.
An solution is to desactivate every click on the document and re-activate when datatable is fully loaded but i would like something more efficient.
[code]
$(document).click(function() {
alert('datatable is'nt fully loaded');
return(false);
});
$('#my-datatable').dataTable({
.....,
.....,
"fnInitComplete": function() {
$(document).unbind('click');
}
[/code]
Thanks in advance.
This discussion has been closed.
Replies
Allan
Yes, the warning is there for a reason, the document hasn't finished to load, but the user doesn't wait.
I want to remove this.
It's logical because the document isn't fully loaded, but i'm not going to allow the user to click on a link which is
How can i remove a warning caused by the fact to go on an another page (click on a link) ?
Allan
the customization of the datatable is doing. In consequence, i have an error message if the user click on an link before the datatable is fully loaded.
I've been investigating this, as it's a bit nasty... What appears to be happening is that the web-browser is telling jQuery to run all functions which are attached using $(document).ready() before the DOM has loaded, due to the click! I've filed a bug with Webkit about this ( https://bugs.webkit.org/show_bug.cgi?id=39683 ), and will also do so with Mozilla. This behaviour seems very odd to me - but all of the browsers do it - so I think I need to come up with some kind of work around. I just don't know what yet...
Regards,
Allan
I think the simplest work around would be to have some kind of flag like 'sErrMode' to allow disabling of these types of warnings too. I think any and all 'alert' calls should be disable-able for use on a production site - users don't care that I am a terrible programmer and can't make the number of td elements consistent in every row.
It may be an alternative to allow a user defined function to run when an error/warning occurs, to allow the programmer to provide his own error message.
sErrMode does indeed allow you to disable the alert()s. Just set it to 'throw' and it will throw a JS error rather than an alert warning. The reason 'throw' is not the default, is because a surprising number of posts in the forum are rooted from missing a JS error... However, an alert you cannot miss! As I roll out more debugging tools for DataTables, I hope to be able to set 'throw' to the default in future.
Allan