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

ImageBrowser / FileBrowser - How do I override the select event?

1 Answer 270 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 15 Sep 2014, 06:45 PM
I want to implement an Outlook / email style control when attaching files.  I need to override the Filebrowser event to NOT insert a link to the document, I just need to know the ID of the document so I can store it separately.  Is there any way to do this?  I don't see any events for File / image browsers.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 17 Sep 2014, 03:39 PM
Hello Aaron,

The desired result requires three steps:

1. Obtain a reference to the ImageBrowser or FileBrowser widget after it is opened. The following forum post shows how to do that.

http://www.telerik.com/forums/readonly-folders-for-file-and-image-browser#BHo2ATM2gk2liWGFDXfRTg

(use .k-insertFile for the FileBrowser toolbar icon)


2. Disable the native ImageBrowser or FileBrowser functionality:

var element = $(".k-imagebrowser"); // or .k-filebrowser
  
element.data("kendoImageBrowser").unbind("apply"); // or kendoFileBrowser
element.closest(".k-window").find(".k-dialog-insert").off("click");


3. Attach new apply and click handlers that do whatever you need. The following documentation section shows how to attach widget event handlers after initialization via bind.

http://docs.telerik.com/kendo-ui/basics/events-and-methods#bind-to-the-widget-events

More information about the FileBrowser and ImageBrowser is available here:

http://www.telerik.com/forums/file-manager-2caeaccf98d2

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Editor
Asked by
Aaron
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or