This question is locked. New answers and comments are not allowed.
Hi,
I put Edior component (latest public release) on a page and submit it to server side, and save data.
1) If set Encode(true):
I get the encoded content at server side without problem, but when I retrieve the saved data and bind to the Editor, Editor can't decode the encoded data and can't show the content properly.
For example, I input "123", and posted data is "<strong>123</strong>", when re-bind the data to Editor, it shows "<strong>123</strong>".
2) If set Encode(false):
I always get encoded content at server side, the value of hidden textarea is always encoded, so I get the .
I traced telerik.editor.js, and found this intresting function:
as traced, it equals below statement, which means the value parameter is never assigned to textarea, if value is passed in function, encodedValue is used
so I wonder should it be:
and for the blur event, encoded setting is not considered, encodedValue is always used
so I wonder should it be:
If I made above two changes, the value of hidden textarea will be non-encoded value.
Then for the first sample, I input "123", and posted data is "<strong>123</strong>", when re-bind the data to Editor, it shows "123".
Could you check whether above two cases are designed or issues?
Regards
Wicky
I put Edior component (latest public release) on a page and submit it to server side, and save data.
1) If set Encode(true):
I get the encoded content at server side without problem, but when I retrieve the saved data and bind to the Editor, Editor can't decode the encoded data and can't show the content properly.
For example, I input "123", and posted data is "<strong>123</strong>", when re-bind the data to Editor, it shows "<strong>123</strong>".
2) If set Encode(false):
I always get encoded content at server side, the value of hidden textarea is always encoded, so I get the .
I traced telerik.editor.js, and found this intresting function:
update: function (value) { this.textarea.value = value || this.encoded ? this.encodedValue() : this.value(); }, this.textarea.value = (value || this.encoded) ? this.encodedValue() : this.value();this.textarea.value = value || (this.encoded ? this.encodedValue() : this.value());and for the blur event, encoded setting is not considered, encodedValue is always used
$(editor.window) .bind('blur', function () { var old = editor.textarea.value, value = editor.encodedValue(); editor.update(value); if (value != old) { $t.trigger(editor.element, 'change'); } }); value = editor.encoded ? editor.encodedValue() : editor.value();If I made above two changes, the value of hidden textarea will be non-encoded value.
Then for the first sample, I input "123", and posted data is "<strong>123</strong>", when re-bind the data to Editor, it shows "123".
Could you check whether above two cases are designed or issues?
Regards
Wicky