Closed jkabat closed 4 years ago
@freezy-sk does this stem from https://github.com/omines/datatables-bundle/pull/130?
@jkabat can you elaborate more on the symptoms, do you get errors in the JS console?
No, there are no errors. DT events in .then{} part of Promise simply does not fire. They are fired properly when CDN translations are used.
Uh no clue then, waiting on @freezy-sk feedback.
@curry684 I think that update of translations can't cause this issue. @jkabat could you please verify if it works correctly with 0.4.0?
I'm using latest tagged version. I think #130 is not yet included in it, so issue is caused either by translations bundled with tagged version or by datatables JS library itself.
@curry684 I've made simple test #139 to check if translations are rendered and escaped correctly and it looks ok
Hmm indeed #130 is not tagged yet. If the language files are bugging out it might actually fix it as well. Can you try with dev-master
@jkabat ?
I have tried it and the result is the same... but after a second thinking I have to admit, that everything is probably OK and this issue can be closed.
When table is rendered with external language file, labels are updated and table events properly fired. On other hand, when translated labels are provided on table init, there is no need for firing DT events... and they are not.
This bundle issues POST on the first load of the page and all bound events on dynamic content are lost. I have wrongly expected to have either INIT or DRAW event fired after this POST. So now I have to find other way to reinitialize components (eg: filter input with datetime picker is not working unless I force table reload to have appropriate event fired....) Any ideas how to work around this issue?
Actually it was frontend issue, sorry for spamming.
I've changed daterangepicker init from:
$(this.selector).each(function(index) {
to
$('body').on('focus', this.selector, function() {
Translations provided in options create conflict with JS datatables events. I'm not sure if the issue is caused by contents of translation keys or it is known issue with JS library. Unfortunately locale in format 'fr_FR' forces Symfony translations instead of CDN URL.
One possible solution can be: