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

headerStatusUploaded says "Done" even if upload failed

5 Answers 70 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Maximilian
Top achievements
Rank 1
Veteran
Maximilian asked on 14 May 2020, 03:18 PM

Hi there,

I am trying to improve the accessibiliy of the Kendo UI Upload. My biggest problem right now is that the "headerStatusUploaded" always says "Done", even if the upload failed. The failure is just communicated by the exclamation mark. See picture attached.

To me "Done" sounds like everything went fine. This is especially bad for accessibility because the exclamation mark is not read by screen readers, but I also find it irritating as a not disabled user.

Best, Max

5 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 18 May 2020, 07:22 AM

Hello Maximilian,

You can change the headerStatusUploaded message as you wish through the localization.headerStatusUploaded configuration:

localization: {
    headerStatusUploaded: "enter your messages here."
}

Let me know if that would resolve the issue. Looking forward to your reply.

Regards,
Martin
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.
0
Maximilian
Top achievements
Rank 1
Veteran
answered on 18 May 2020, 08:04 AM

Hello Martin,

thanks for the answer.This would solve my problem, if I could set the headerStatusUploaded at runtime. But that isn't possible, or is it?

Otherwise it would just display the new message regardless of the outcome of the upload.

Best, Max

0
Accepted
Martin
Telerik team
answered on 20 May 2020, 07:36 AM

Hello Max,

You could change the message if there are any validation files for a file in the select event. Please refer to the below code snippet:

select: function(e) {
  var files = e.files;
  
  for	(var i = 0; i < files.length; i += 1) {
  	var file = e.files[i];
    
    if (file.validationErrors) {
      setTimeout(function() {
        var headerStatusSpan = $('.k-upload-status.k-upload-status-total');
        var contents = headerStatusSpan.contents();
        contents[1].textContent = 'Custom text on validation error';
      }, 0);
    }
  }
}

Here you will find a small Dojo example for reference.

Let me know if that works for you.

Regards,
Martin
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.
0
Maximilian
Top achievements
Rank 1
Veteran
answered on 25 May 2020, 10:14 AM

Thanks, Martin! That works for me. 

Can you maybe explain, why to use setTimeout there?

0
Maximilian
Top achievements
Rank 1
Veteran
answered on 25 May 2020, 10:26 AM
Just found an explanation for the use of setTimeout somewhere else.
Tags
Upload
Asked by
Maximilian
Top achievements
Rank 1
Veteran
Answers by
Martin
Telerik team
Maximilian
Top achievements
Rank 1
Veteran
Share this question
or