Question

Is it possible to add kendo uploader inside kendo ListView?

<script type="text/x-kendo-tmpl" id="templateMessage">
    <div class="Row" style="padding: 2px 2px 2px 2px !important;">
        <div style="width: 15%; float: @_Layout.Align; padding-left: 2px;" class="gridText">
            #:CheckList#     
        </div>
        <div style="width: 50%; float: @_Layout.Align; padding-left: 2px;" class="gridText">
            @(Html.Kendo().Upload()
                .Name("file")
                .Async(a => a
                    .Save("SavePic", "Home")
                    .Remove("RemovePic", "Home")
                    .AutoUpload(true))
                .Multiple(false)            
            )
        </div>
    </div>
</script>
Was it helpful?

Solution

Few points that you need to cover:

  1. all the ToClientTemplate extensions when you position widget inside a client template.
  2. escape the sharp symbols if you have used any inside your widget declaration:

    function(e) { e.data = { id: $("\#Id").val() }; }

OTHER TIPS

I think it's possible. Just have to always remember calling the ToClientTemplate() method when using kendo widgets in a client template.

In this case:

@(Html.Kendo().Upload()
            .Name("file")
            .Async(a => a
                .Save("SavePic", "Home")
                .Remove("RemovePic", "Home")
                .AutoUpload(true))
            .Multiple(false)            
            .toClientTemplate()
        )

UPDATED: You may escape use "#" in JavaScript strings using "\\#" and in HTML script templates using "\#".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top