Image Browser Sorting or Selecting

5 posts, 1 answers
  1. Jackie
    Jackie avatar
    17 posts
    Member since:
    Jun 2017

    Posted 15 Nov 2017 Link to this post

    Hello,

    I have an image browser that users are going to be uploading a large number of files to. I'm wondering if it is possible to do one of the following two things to help them manage these images:

    1) Sort images shown in the browser by date, rather than name.

    2) Automatically select an image on upload. 

    Thank you! 

  2. Ianko
    Admin
    Ianko avatar
    1800 posts

    Posted 17 Nov 2017 Link to this post

    Hello Jackie,

    Ordering by date is not possible as this information is not retrieved by the current implementation of both FileBrowserController and the ImageBrowser UI component. For that to be achieved both needs to be modified accordingly. 

    As for automatic selection, it is possible by handling the events and API of the child widgets used by the ImageBrowser (https://docs.telerik.com/kendo-ui/controls/editors/editor/how-to/integration/get-reference-to-imagebrowser-child-widgets). Here you are a dojo that could serve you as a starting point:  http://dojo.telerik.com/oPopU

    Regards,
    Ianko
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Jackie
    Jackie avatar
    17 posts
    Member since:
    Jun 2017

    Posted 17 Nov 2017 in reply to Ianko Link to this post

    Thanks Ianko,

    Looking at your example, I see how you're getting a list of all the uploaded images in the line where you define fileToSelect.

    Is there a way to figure out which image was just uploaded? I'm hoping to have an image be selected by default after it is uploaded. 

    Thank you!

  4. Answer
    Dimitar
    Admin
    Dimitar avatar
    454 posts

    Posted 21 Nov 2017 Link to this post

    Hello Jackie,

    I am attaching an ASP.NET MVC solution, where a similar scenario to the one described is demonstrated (Retrieve uploaded file upon upload success with the ImageBrowser of the Kendo UI Editor and automatically select it in the ListView).

    To achieve the desired result, I have incorporated the approach that my colleague Ianko provided earlier:
    • Attach a click event handler to the ImageBrowser button on the toolbar of the Editor.

    • Get a reference to the upload widget of the ImageBrowser and bind a success event handler to it.

    • On success, search for the currently uploaded file in the ListView of the widget and use the ListView's select() method to select the item.

    In addition to the above, you should be able to retrieve additional data if needed for the uploaded file through the event object in the success event handler (ev.files). 

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Jackie
    Jackie avatar
    17 posts
    Member since:
    Jun 2017

    Posted 27 Nov 2017 in reply to Dimitar Link to this post

    That works perfectly Dimitar. Thank you!
Back to Top