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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get image in RTE on TreeGrid click

Thread ID:





130506 May 16,2017 11:51 AM UTC May 19,2017 08:38 AM UTC Angular 1
Tags: ejRTE
Asked On May 16, 2017 11:51 AM UTC


is there a possibility on button/grid cell click show image in ReachTextEditor? Now I am able just to show that picture as background image, but I want to have it like normal picture, but added from other source (clicking grid), not only using image tool / imageBrowser property.

Now my function looks like this (it shows picture getting from database like base64 like background in rich text editor):
 onTreeGridClick(args) {
      var img = new Image();
     img.src = args.row[0].attributes[2].ownerElement.lastElementChild.firstElementChild.currentSrc;
          iframeAttributes:{ style: "background: url(" + img.src + ") no-repeat;" }

Prince Oliver [Syncfusion]
Replied On May 19, 2017 08:38 AM UTC

Hi Agne,   
Thank you for contacting Syncfusion support.   
To insert an image in RTE control on button click, we can use the setHtml method and set image to RTE using image tag with src attribute set to the location of the image. Kindly refer to the following code snippet.   
       function btn1click() { 
           var rteObj = $("#rteSample").data("ejRTE"); 
           rteObj.setHtml("<img src='https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png' />"); 
Refer to the following link for Playground Sample: http://jsplayground.syncfusion.com/avgcko1g 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon