-
Bug
-
Resolution: Fixed
-
Normal
-
8.5.0.1, 9.6.0
-
Security Level: Jimmy
Steps to Reproduce
https://zkfiddle.org/sample/2t2e5nf/2-tbeditor-setValue-not-working
Run fiddle
Press "value to foo"
Press "value to bar"
press "rerender"
Current Result
Nothing after the first 2 buttons.
value set to bar after rerender
(source is changed, but not display)
Expected Result
setValue sets the value
Debug Information
js for setValue:
this._editor.trumbowyg('html', this._value);
This appear to not work reliably
this._editor.html(this._value);
seem more reliable
this is a Trumbowyg 2.6.0 bug
https://github.com/Alex-D/Trumbowyg/issues/567
Workaround
<script><![CDATA[ zk.afterLoad("zkmax.inp", function () { var _xTbeditor = {}; zk.override(zkmax.inp.Tbeditor.prototype, _xTbeditor, { setValue: function(val) { this._value = val if (this.desktop && this._editor) { if (this._value) this._editor.html(this._value); else this._editor.trumbowyg('empty'); } } }); }); ]]></script>