kendoImageBrowser with custom model?

4 posts, 0 answers
  1. Stoyan
    Stoyan avatar
    9 posts
    Member since:
    Jan 2015

    Posted 19 Feb 2015 Link to this post

    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"]
        });
     });
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 23 Feb 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Stoyan
    Stoyan avatar
    9 posts
    Member since:
    Jan 2015

    Posted 23 Feb 2015 in reply to Alex Gyoshev Link to this post

    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! 
  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 24 Feb 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready