Closed TCAby closed 1 year ago
Okay, I got out of it, I found a workaround through a direct property request:
let request_body = $('#request_body')[0].innerHTML
But I'd still like to solve this problem properly, through library methods.
To be honest, I did not understand the bug ; and I the mentioned error is due to not having Trumbowyg loaded at all, so I cannot really help :/
stop-stop, @Alex-D ! Trumbowyg loaded! Loaded, working, uses its top-panel (and I added some custom buttons there also)! But I can't get values from it. How can I show you details? By Zoom (sharing the screen) for example..
Really I read closed issue #995 but my case doesn't be solved by given advices.
Description
System information (is it necessary):
Expected behavior
I want to get html from editor and POST the result with an AJAX request if onClick event occurs.
then on onclick event I want to read the value in the editor - and I'm getting an error "Uncaught TypeError: $(...).trumbowyg is not a function":
My attempts to solve it:
Both of my ideas based on that initial part $('#request_body').trumbowyg('html', body_feedback_request) is Ok.
1) tried to call function (//getEditorValue('#request_body')) instead of direct call inside the event 2) tried to use inline function like
3) After I read case995, I tried move initialithation inside the $(document).ready(function(){ }) - nothing. More than: errors started fro the first line of 'trumbowyg' block: $.trumbowyg.svgPath = trumbowyg_svg; - error. Move ot outside the $(document).ready(function(){ - next error on $('#request_body').trumbowyg({ ... and so on.
But when I tried read value like
console.log($('#request_body').trumbowyg('html'))
directly after $('#request_body').trumbowyg('html', body_feedback_request) all is OK!Errors which occurs
Uncaught TypeError: $(...).trumbowyg is not a function at HTMLButtonElement. (tca-pcab-superadmin-cabinet-editdesigner.js:889:43)
at HTMLButtonElement.dispatch (jquery.min.js?ver=3.6.1:2:43064)
at y.handle (jquery.min.js?ver=3.6.1:2:41048)