EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: fgendorf on November 14, 2017, 10:07:33 AM



Title: [SOLVED] Extension texteditor in form
Post by: fgendorf on November 14, 2017, 10:07:33 AM
Hi, is that possible load content in texteditor extension by .form('load',DATA); ?

Thanks for advance


Title: Re: Extension texteditor in form
Post by: stworthy on November 15, 2017, 08:22:36 PM
You have to call 'setValue' method to load the texteditor's data.
Code:
$('#te').texteditor('setValue', data);


Title: Re: Extension texteditor in form
Post by: fgendorf on November 16, 2017, 03:13:24 AM
Thanks for answer, I know that to put a value in a texteditor I must use setValue, but when a texteditor is inside a form, and DATA is a json with all fields from form, the method .form('load',DATA) fulfill all fields but not fields with texteditor.


Title: Re: Extension texteditor in form
Post by: proceno72 on November 16, 2017, 07:15:10 AM
Thanks for answer, I know that to put a value in a texteditor I must use setValue, but when a texteditor is inside a form, and DATA is a json with all fields from form, the method .form('load',DATA) fulfill all fields but not fields with texteditor.

When you define your form, you could automatically call setValue on load success event. Like this:
Code:
$('#myform').form({
        onLoadSuccess: function (data) {
                $('#te').texteditor('setValue',data.fieldName);
        }
});


Title: Re: Extension texteditor in form
Post by: fgendorf on November 16, 2017, 07:35:11 AM
Thank you! ;D