how to disable local image selection in RTE image selection dialog

How I Can disable Local computer image selection from RTE image selection dialog. allow image url only to used for image picker


3 Replies

VY Vinothkumar Yuvaraj Syncfusion Team June 13, 2023 10:08 AM UTC

Hi Khalid,


To disable the "Upload the image locally" option in the Rich Text Editor, you can use the dialogOpen event to disable it. Please refer to the following code and attached sample for guidance.


<ejs-richtexteditor id="default" dialogOpen="dialogOpen">

    <e-content-template>

        <div>

……….

        </div>

</e-content-template>

</ejs-richtexteditor>

 

<script>

    function dialogOpen(e) {   

        if (e.container.classList.contains("e-rte-img-dialog")) {

document.querySelector(".e-img-content .e-img-uploadwrap").style.display = 'none'

        }

    }

</script>


API Link : https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.RichTextEditor.RichTextEditor.html#Syncfusion_EJ2_RichTextEditor_RichTextEditor_DialogOpen


Please let us know if you have any concerns.


Regards,

Vinothkumar


Attachment: SyncfusionWebApplication1_adbac815_95953e6f.zip


KM Khalid Mahmood June 14, 2023 05:41 AM UTC

Thanks @Vinothkumar Yuvaraj for you help.

I have used simple css style embeded in layout 

<style>

    .e-img-uploadwrap {

        display: none !important;

    }

</style>
 



VY Vinothkumar Yuvaraj Syncfusion Team June 15, 2023 04:25 AM UTC

Hi Khalid,


You're welcome, we are glad your problem has been solved. Please get back to us if you have any further questions.


Loader.
Up arrow icon