How do I bind a collection of attachment objects to the kendo upload?

1 Answer 293 Views
Upload
Matt
Top achievements
Rank 1
Iron
Iron
Matt asked on 07 Oct 2021, 05:36 PM

Right now I created a separate grid but I would like to have the list of attachments part of the file upload control if possible. How do I iterate through a collection and bind the filename, download link, remove etc..  inside the upload control ? 

 

the way I do it now is simply

<div>
        <ul>
            <li *ngFor=" let a of attachments">
                {{a.name}}
                <button type="button" (click)="download(a)">download</button>
                <button type="button" (click)="deleteAttachment(a)">delete</button>
            </li>
        </ul>
    </div>

 

1 Answer, 1 is accepted

Sort by
0
Slavena
Telerik team
answered on 12 Oct 2021, 12:38 PM

Hello Matt,

Thank you for the provided code snippet.

Customizing the list of attachments could be achieved by utilizing one of the component's templates - the File template or the File Info template. The templates provide a different level of customization. More information on this topic could be found on the following link from our documentation:

https://www.telerik.com/kendo-angular-ui/components/uploads/upload/templates/

In the demo below I have utilized the File template by nesting a <ng-template> with the kendoUploadFileTemplate directive applied to it. This approach provides a full control of the files' appearance:

https://stackblitz.com/edit/angular-hucxtf?file=app%2Fupload.component.ts

I hope this helps.

Regards,
Slavena
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
Tags
Upload
Asked by
Matt
Top achievements
Rank 1
Iron
Iron
Answers by
Slavena
Telerik team
Share this question
or