We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to change default multiline textbox editor to RichTextEditor?

Hi!

How to change default editor description field textbox to rich texteditor?

<ejs-schedule id="schedule"
selectedDate="@DateTime.Now.Date"
allowDragAndDrop="true"
firstDayOfWeek="1"
locale="hu">
<e-schedule-eventsettings>
<e-data-manager url="@Url.Action("GetSchedule")"
crudUrl="@Url.Action("UpdateSchedule")"
adaptor="UrlAdaptor"></e-data-manager>
<e-eventsettings-fields id="id">
<e-field-subject name="subject" />
<e-field-starttime name="startTime" />
<e-field-endtime name="endTime" />
<e-field-starttimezone name="startTimeZone" />
<e-field-endtimezone name="endTimeZone" />
<e-field-location name="location" />
<e-field-description name="description" type="e-richtexteditor"/>
<e-field-isallday name="isAllDay" />
<e-field-recurrenceid name="recurrenceId" />
<e-field-recurrencerule name="recurrenceRule" />
<e-field-recurrenceexception name="recurrenceException" />
</e-eventsettings-fields>
</e-schedule-eventsettings>
</ejs-schedule>

Can only a custom template solve this?
If so, where can I find the default template?

Thanks,
Peter

3 Replies

VM Vengatesh Maniraj Syncfusion Team January 6, 2020 12:00 PM UTC

Hi Peter, 

Syncfusion greetings. 

We can achieve this by making use of editorTemplate field and we have prepared the sample based on the requirement which is available in below link, 


In the above sample, we have used popupOpen event to render the RichTextEditor control like below, 

function onPopupOpen(args) { 
        if (args.type === 'Editor') { 
            var statusElement = args.element.querySelector('#EventType'); 
            if (!statusElement.classList.contains('e-dropdownlist')) { 
                var dropDownListObject = new ej.dropdowns.DropDownList({ 
                    placeholder: 'Choose status', value: statusElement.value, 
                    dataSource: ['New', 'Requested', 'Confirmed'] 
                }); 
                dropDownListObject.appendTo(statusElement); 
                statusElement.setAttribute('name', 'EventType'); 
            } 
            var startElement = args.element.querySelector('#StartTime'); 
            if (!startElement.classList.contains('e-datetimepicker')) { 
                new ej.calendars.DateTimePicker({ value: new Date(startElement.value) || new Date() }, startElement); 
            } 
            var endElement = args.element.querySelector('#EndTime'); 
            if (!endElement.classList.contains('e-datetimepicker')) { 
                new ej.calendars.DateTimePicker({ value: new Date(endElement.value) || new Date() }, endElement); 
            } 
 
            var reasonElement = args.element.querySelector('#Description'); 
            var rteValue = args.target.classList.contains("e-work-cells") ? args.data.Description : args.data.Description; 
            if (!reasonElement.classList.contains('e-richtexteditor')) { 
                var richtextEditorObject = new ej.richtexteditor.RichTextEditor({ 
                    value: rteValue 
                }); 
                richtextEditorObject.appendTo(reasonElement); 
                reasonElement.setAttribute('name', 'Description'); 
            } 
        } 
    } 


Kindly try the above sample and revert us for further assistance. 

Regards, 
Vengatesh 



PB Peter Barasits January 6, 2020 07:57 PM UTC

Thank you!

And how to call image upload controller (from RTE)? And how to add Textboxt with placeholder?



VM Vengatesh Maniraj Syncfusion Team January 7, 2020 07:16 AM UTC

Hi Peter, 

Thanks for the update. 

We can call the controller from RichTextEditor using the SaveUrl method and the destination path through Path property like below UG. And the same, we have added placeholder for Textbox that can be viewed from below sample. 
  

Screenshot :  

 





















Kindly try the above sample and let us know if you need any further assistance on this. 

Regards, 
Vengatesh 


Loader.
Live Chat Icon For mobile
Up arrow icon