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

Image Browser Sorting or Selecting

4 Answers 252 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jackie
Top achievements
Rank 1
Jackie asked on 15 Nov 2017, 04:51 PM

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! 

4 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 17 Nov 2017, 12:25 PM

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.
0
Jackie
Top achievements
Rank 1
answered on 17 Nov 2017, 09:09 PM

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!

0
Accepted
Dimitar
Telerik team
answered on 21 Nov 2017, 04:04 PM
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.
0
Jackie
Top achievements
Rank 1
answered on 27 Nov 2017, 05:06 PM
That works perfectly Dimitar. Thank you!
Tags
Editor
Asked by
Jackie
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Jackie
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or