Datatables breaks when gtranslate bar appear
Datatables breaks when gtranslate bar appear
Hello,
Im new here and my english is not good.
My website have admin panel (its based on wp 6.3.1)
Im using payed template from themeforest (codecanyon/envato). Everything is good, but when i added this shortcode:echo do_shortcode('[gtranslate]'); and when google translate bar appear - datatables stop working.
It gives me this error:
DataTables warning: table id=din-table - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
I try to add a class to tables with jquery $("body").find(".tableWrap").addClass("notranslate"); and when i open dev console and inspect the element - the class is added and the tables not translated, but error still appear.
Can you gives me a suggestion how to fix this issue ?
Version of the datatables is: 1.10.12 and datatables responsive: 2.1.0
Thanks for any replies!
Replies
The place to start is to use the troubleshooting steps found at the link in the error:
http://datatables.net/tn/1
Let us know what you find.
Can you post a link to your page or a test case showing the error so we can help debug?
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
The problem is inserting the do_shortcode('[gtranslate]') without event.
when i type in my functons.php echo do_shortcode('[gtranslate]') - the widget is inserted above all html elements before <html> tag.
I search and found a event inside body tag and my code looks like this now:
everything is OK for now. The event admin_notices is about insert a alert boxes but i cant found proper event.. My template is payed and is not good at all... I search for different events for wp like wp_footer or wp_body but i try with them without success..
Maybe my template is not supporting them..
For now everything is OK, thank you !
Just a note to say that DataTables is open source and entirely free. If you've paid for something that isn't providing the expected functionality, it would be worth contacting the provider and explaining to them,
Colin