FileBrowser thumbnail image (file type)

4 posts, 0 answers
  1. Matjaz
    Matjaz avatar
    94 posts
    Member since:
    Jun 2014

    Posted 08 Oct 2014 Link to this post

    How can I set thumbnail image for FileBrowser. ImageBrowser has thumbnailUrl configuration.
    I would like to show pdf icon if the file is pdf, word icon if the file is word, zip icon if the file is archive ...
  2. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 10 Oct 2014 Link to this post

    Hello Matjaz,

    You can use the dataBound event of the ListView widget inside the FileBrowser to iterate all <li> elements and apply custom CSS styles, depending on the file name inside.

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

    Regards,
    Dimo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Matjaz
    Matjaz avatar
    94 posts
    Member since:
    Jun 2014

    Posted 16 Oct 2014 Link to this post

    Hi.
    I need this functionality for FileBrowser and for Editor->FileBrowser.
    I already extend you widgets with my own. The best logic would be to do this inside init method:
    var MatjazEditor = kendo.ui.Editor.extend(
        {
            init: function(element, options)
            {
                if (options.tools != undefined)
                {
                    if (options.tools.indexOf("insertImage") != -1)
                        Matjaz.InitImageBrowser(options.imageBrowser);
                    if (options.tools.indexOf("insertFile") != -1)
                        Matjaz.InitFileBrowser(options.fileBrowser);
                }
                 
                kendo.ui.Editor.fn.init.call(this, element, options);
                kendo.notify(this);
            },
            options:
            {   
                name: "MatjazEditor",
            }
        });
        kendo.ui.plugin(MatjazEditor);
    I am having problem with getting listView reference as pointed in url you provided.
    Please help me, how can I get listView in FileBrowser and Editor->FileBrowser.
  5. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 20 Oct 2014 Link to this post

    Hello Matjaz,

    The File and Image Browsers of the Editor are created on demand, when the respective popup is opened, and they are destroyed, when the popup is closed. The File and ImageBrowsers do not exist in the init event of the Editor, so the internal ListView widget does not exist then either. You need to think of some other approach, for example extend the FileBrowser widget as well and add a custom dataBound handler there in its init method. Keep in mind that the ListView already has a dataBound handler attached, so in order to preserve it, attach you custom handler with bind.

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

    Regards,
    Dimo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready