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

Extend the existing Upload ng-template

1 Answer 64 Views
Upload
This is a migrated thread and some comments may be shown as answers.
waircit
Top achievements
Rank 1
Veteran
waircit asked on 26 May 2020, 05:30 AM

I would like to customise the Template using the technique described in the API reference, and similar to one of the other threads in this forum. I have used this example posted by an admin to another thread: https://stackblitz.com/edit/angular-gmuolt-jxzifm?file=app/upload.component.ts

However, I find that when you add an ng-template, all of the default template, including default nice UX is removed.

Is it possible to instead customise the existing Template, for example by adding a second"row" or "li".

If not, how would I go about recreating the UX elements from the default template to use in my custom template?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 27 May 2020, 12:28 PM

Hi,

Indeed, currently the Upload template gives full control over the whole content only. If needed all original items from the default layout can be recreated in the template by inspecting the DOM and copying the respective elements and styling.

For example, the progress bar at the bottom of each file can be rendered by adding a <span class="k-progress"></span> tag inside the template. The width of this progress bar should change according to the upload progress of the file. This can be done by using the UploadProgressEvent. This event fires each time a file is uploading and can be used for receiving information about the files being uploaded and the percentComplete (the portion uploaded).

https://www.telerik.com/kendo-angular-ui/components/uploads/api/UploadProgressEvent/

https://stackblitz.com/edit/angular-gmuolt-jxzifm?file=app/upload.component.ts

I hope this helps, but if you have the time, please support the following feature request in our Feedback Portal:

https://feedback.telerik.com/kendo-angular-ui/search?searchterm=upload+template

We are tracking the customer demand for an enhancement that would allow to keep the general look and feel of the Upload template, and customize only part of the content, and will consider adding it to our future plans, based on the interest.

Regards,
Dimiter Topalov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Upload
Asked by
waircit
Top achievements
Rank 1
Veteran
Answers by
Dimiter Topalov
Telerik team
Share this question
or