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

Validation UI section - turn off retry

8 Answers 114 Views
Upload
This is a migrated thread and some comments may be shown as answers.
BitShift
Top achievements
Rank 1
Veteran
BitShift asked on 12 Oct 2020, 07:30 PM
Is there a way to turn off the "retry" element after a file has been selected and it has errored?

8 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 13 Oct 2020, 07:31 AM

Hello,

If the reason you're asking is because retrying does not fire OnUpload again, you can Follow a fix for that here. I've also added there a bit of CSS that you can use to hide the retry button.

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
BitShift
Top achievements
Rank 1
Veteran
answered on 14 Oct 2020, 06:33 PM

Well, in my situation I have defined filetype restictions, which seems to fire client-side validation but I also do server-side checks on the file before saving the file to its destination, and if those checks fail I return a BadRequestObjectResult and use an error handler. 

So maybe the best way to deal with this is to either do all the checks server-side, but when the error happens I am just showing an alert via a modal window component. How could I turn off / hide the file "history" that shows up after an upload?

0
Marin Bratanov
Telerik team
answered on 14 Oct 2020, 06:45 PM

Hello,

There are two feature requests for something similar to that - please check them and see which is the one you need so you can Vote for it and Follow it:

From what I understand, the file would never be able to be valid in your case, so re-uploading would not make sense and thus hiding the Retry button with CSS should work. It would, perhaps be nice if you could remove it and keep the list of successful ones, which would be possible after both features above are implemented.

If this is not what you seek, could you provide some more details on what functionality you would want from the component? It is important to consider that the Retry button may be meaningful if some metadata on the file can change (which is something you collect through OnUpload), or there was a network issue.

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
BitShift
Top achievements
Rank 1
Veteran
answered on 15 Oct 2020, 08:02 PM
Hmm, yes I think either clearing this list after an upload (whether successful or not) would help, but also having the option to enable/disable this list completely I think would also help.  
In the UI, after an upload there is a <ul> element with class = "k-upload-files k-reset" that I guess I could just set visibility = none?
I think its this option that would better fit what I am trying to do
0
Marin Bratanov
Telerik team
answered on 16 Oct 2020, 12:52 PM

Hello,

You could use CSS to hide the list, there is no issue with that. You could wrap the upload in a <div> whose class you can set dynamically based on a flag you raise in OnSuccess or OnError, in order to cascade through it and hide the list conditionally, if you don't want to hide it all the time.

 

Regards,
Marin Bratanov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
BitShift
Top achievements
Rank 1
Veteran
answered on 19 Oct 2020, 03:49 PM
Wouldnt want to hide the entire upload widget, just the file(s) history that shows after an upload. What css would I use to hide just the list?  I believe its an <ul> element that is only added to the UI after the upload?
0
Marin Bratanov
Telerik team
answered on 19 Oct 2020, 04:02 PM

Hi,

The following blog post can help you inspect the HTML rendering and classes in order to devise the rule you need for the outcome you want: https://www.telerik.com/blogs/improve-your-debugging-skills-with-chrome-devtools

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
BitShift
Top achievements
Rank 1
Veteran
answered on 19 Oct 2020, 04:21 PM
I think I found another way, just place the Upload widget in a wrapping div that has a height not much more than the button and the file history wont be visible.
Tags
Upload
Asked by
BitShift
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
BitShift
Top achievements
Rank 1
Veteran
Share this question
or