magento 2 add wysiwyg editor in custom module,magento add wysiwyg editor to textarea,magento 2 wysiwyg editor,wysiwyg magento 2,magento 2 wysiwyg editor not working,magento 2 ui component form,magento wysiwyg editor tutorial,magento 2 wysiwyg images not showing

In Magento 2 if you want to add the WYSIWYG editor with the text area field with the form ui component in xml file then read this post.Suppose you are using the following code in xml file.

<field name="detail">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">textarea</item>
                    <item name="source" xsi:type="string">sample_shop</item>
                    <item name="label" xsi:type="string">Detail</item>
                </item>
            </argument>
        </field>

 

then In your ui component form xml file add the field like this.

 <field name="detail">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">wysiwyg</item>
                    <item name="source" xsi:type="string">sample_shop</item>
                    <item name="label" xsi:type="string">Detail</item>

                    <item name="template" xsi:type="string">ui/form/field</item>
                    <item name="wysiwyg" xsi:type="boolean">true</item>
                    <item name="dataScope" xsi:type="string">detail</item>
                    <item name="sortOrder" xsi:type="number">50</item>
                    <item name="rows" xsi:type="number">8</item>
                </item>
            </argument>
        </field>

 

done ! no your problem will be solved.