This is a migrated thread and some comments may be shown as answers.

Image Browser custom alert

4 Answers 114 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Pawel
Top achievements
Rank 1
Pawel asked on 03 Aug 2018, 07:54 AM

How I can override alert from ImageBrowser from f.e "invalidFileType" ?

 

Because it is native web browser popup.

01.$("#editor").kendoImageBrowser({
02.            messages: {
03.                deleteFile: "@Html.Raw(ImageBrowser.DeleteFile.JsEscape())",
04.                directoryNotFound: "@Html.Raw(ImageBrowser.DirectoryNotFound.JsEscape())",
05.                emptyFolder: "@Html.Raw(ImageBrowser.EmptyFolder.JsEscape())",
06.                invalidFileType: "@Html.Raw(ImageBrowser.InvalidFileType.JsEscape())",
07.                orderBy: "@Html.Raw(ImageBrowser.OrderBy.JsEscape())",
08.                orderByName: "@Html.Raw(ImageBrowser.OrderByName.JsEscape())",
09.                orderBySize: "@Html.Raw(ImageBrowser.OrderBySize.JsEscape())",
10.                overwriteFile: "@Html.Raw(ImageBrowser.OverwriteFile.JsEscape())",
11.                uploadFile: "@Html.Raw(ImageBrowser.UploadFile.JsEscape())",
12.                dropFilesHere: "@Html.Raw(ImageBrowser.DropFilesHere.JsEscape())",
13.                search: "@Html.Raw(ImageBrowser.Search.JsEscape())"
14.            },
15.            transport: {
16.                type: "imagebrowser-aspnetmvc",
17.                read: "@Url.Action("ReadES", "ImageBrowser", new {id = Model.Id})",
18.                destroy: {
19.                    url: "@Url.Action("DestroyES", "ImageBrowser", new {id = Model.Id})",
20.                    type: "POST"
21.                },
22.                create: {
23.                    url: "@Url.Action("CreateES", "ImageBrowser", new {id = Model.Id})",
24.                    type: "POST"
25.                },
26.                thumbnailUrl: function (path, file) {
27.                    var url = "@Url.Action("ThumbnailES", "ImageBrowser", new { id = Model.Id })" + "?path=" + path + file;
28.                    return url;
29.                },
30.                uploadUrl: "@Url.Action("UploadES", "ImageBrowser", new { id = Model.Id })",
31.                imageUrl: "@Url.Action("Image", "ImageBrowser", new {path = "{0}", id = Model.Id})"
32.            }
33.        });

4 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 06 Aug 2018, 12:39 PM
Hi Pawel,

As you have correctly approach this case, the imageBrowser.messages.invalidFileType option of the Editor should be used. Here you will find a small Dojo sample implementing such scenario.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Pawel
Top achievements
Rank 1
answered on 06 Aug 2018, 12:47 PM

this is not what I'm looking for.

I created my own window for alert and I want to use it instead native alert from JS.

Example below: but message can be only string type.

imageBrowser: {
              messages: {
                dropFilesHere: "Drop files here",
                invalidFileType: function () { myCustomAlert("error") }
              },
0
Pawel
Top achievements
Rank 1
answered on 07 Aug 2018, 09:09 AM

Could you explain me how I can achieve this effect, that my custom popup show up instead native alert js?

thanks in advance

0
Veselin Tsvetanov
Telerik team
answered on 08 Aug 2018, 01:00 PM
Hi Pawel,

I am afraid that a custom pop-up could not be configured to be used for the nvalidFileType alert of the Editor. If you think that such option would add value to the widget, I would suggest you to log your idea on our Feedback portal. Based on the support it receives, we will decide on whether to proceed with its implementation or not.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Editor
Asked by
Pawel
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Pawel
Top achievements
Rank 1
Share this question
or