Export dialog

1 Answer 115 Views
ImageEditor
Kjell
Top achievements
Rank 1
Iron
Iron
Kjell asked on 16 Mar 2023, 06:41 PM

When I use RadImageEditor / Tools / CommandName / CustomSave the image is saved without the dialog box...

What if I want to export the image "CommandName="Export" without the "Save Image on Server" dialog appearing?
Only "Download Image" is displayed....
See picture....

 

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 21 Mar 2023, 01:02 PM

Hello Kjell,

There is no built-in way to hide that option, however, you can use JavaScript/jQuery to access the element and hide it manually.

Example:

<telerik:RadImageEditor ID="RadImageEditor1" runat="server" OnClientDialogLoaded="OnClientDialogLoaded">
</telerik:RadImageEditor>

<script>
    function OnClientDialogLoaded(sender, args) {
        var widget = args.get_widget();

        var dialogName = widget.get_name();

        if (dialogName === "Save") {

            var $dialogElement = $("#" + widget.get_parentId() + "Save");

            var $saveToServerCellElement = $dialogElement.find('.rieDialogsTable .rfdOptionList label[id$=ToolsPanel_C_btnList_1]').closest('td');

            $saveToServerCellElement.hide();
        }
    }
</script>

 

Result

 

I hope this will help.

Regards,
Attila Antal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Kjell
Top achievements
Rank 1
Iron
Iron
commented on 21 Mar 2023, 02:59 PM

Unfortunately no difference, the same dialog appears.......

https://naturskyddsforeningen-varberg.se/image_editor/test.aspx

 

Rumen
Telerik team
commented on 24 Mar 2023, 10:59 AM

Hi Kjell,

The JS example provided by Attila relies on that the dialog name is called "Save" (look for this check dialogName === "Save"). In your scenario, the ImageEditor is localized and the Save dialog has the name "Spara bild". You need to update the Save with "Spara bild" to be able to use the solution in your app

My advice is to also put a debugger in the OnClientDialogLoaded function and see what is returned by the widget.get_name(); to see the real dialog name.

 

An alternative approach is to register the external dialog files of RadImageEditor as explained in this demo and to modify the ImageEditorDialogs/Save.ascx dialog file by removing this item: 

 <asp:ListItem Text="Save Image to Server" /> from the <asp:RadioButtonList control.

Tags
ImageEditor
Asked by
Kjell
Top achievements
Rank 1
Iron
Iron
Answers by
Attila Antal
Telerik team
Share this question
or