Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4916

tbeditor setValue only sets source, doesn't affect display without rerender

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.6.0
    • 8.5.0.1, 9.6.0
    • Components
    • 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>
      

            Leon03 Leon03
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: