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

kendoImageBrowser with custom model?

3 Answers 77 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Stoyan
Top achievements
Rank 1
Stoyan asked on 19 Feb 2015, 12:26 PM
Hello to all,

According to the documentation I can have an extra filed in my schema.model something like "sizeInPxl"? How can I get it displayed in imageBrauser listView? I'm assigning imageBrauser listView to variable and then:

ImageBrowserListView.setOptions({
    template: "<li>#:name# #:sizeInPxl#</li>"
});
It works. But the default template is overridden and everything is falling apart.

Another approach is to add the value of this additional field in listView dataBound event, but I don't like it either

ImageBrowserListView.bind("dataBound", function(e){
    $.each(e.sender.items(), function(index, value){
       ar $value = $(value),
       dataSourceItem = e.sender.dataSource.getByUid($value.data("uid"));
       // Add HTML element to $value with content dataSourceItem["sizeInPxl"]
    });
 });

3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 23 Feb 2015, 08:18 AM

Hello Stoyan,

The ImageBrowser does not support options for changing the item template, but the approach of post-processing the HTML in the dataBound event is good -- it does not depend heavily on the default template. Do you encounter any limitations with it?

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Stoyan
Top achievements
Rank 1
answered on 23 Feb 2015, 09:14 AM
I'm using kendoImageBrowser as standalone widget. I've added a button to every listView item with event listener that opens a full size preview of a image on click in kendoWindow widget.  Than I added crop and resize functionality. Everything works fine.
I've found workarounds for multiple upload and multiple select. The only thing that I'm missing is deleting multiple selected items. I'm trying to find witch event is triggered by "delete" button of the listView but with no luck. Can you give me some directions?
My workaround is to get selected items with listView.select(), unbind the default "click" event and bind my own that sends delete request to server with selected items. But I don't like it :-D.

Best regards! 
0
Alex Gyoshev
Telerik team
answered on 24 Feb 2015, 01:46 PM

Hello Stoyan,

Custom modifications to the widget code are not supported, as stated in the license agreement. If you need this to be implemented in future versions, feel free to submit a feature request on UserVoice.

Regards,
Alex Gyoshev
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
Stoyan
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Stoyan
Top achievements
Rank 1
Share this question
or