Disable only the buttons within Upload component

1 Answer 38 Views
Upload
David
Top achievements
Rank 1
David asked on 11 May 2023, 01:36 PM
Is there a way to disable only the buttons within the Upload component?

I am aware of the `disabled` attribute which disables the whole Component, but I need to disable only the 2 buttons which appear once you have at least 1 file on the list

1 Answer, 1 is accepted

Sort by
0
Accepted
Wissam
Telerik team
answered on 15 May 2023, 10:39 AM

Hello, David,

I believe that you are referring to the `Clear` and `Upload` buttons when the autoUpload prop is set to `false`. Is this correct?

You can disable them by setting their CSS styles `pointer-events` to `none` and `opacity` to `0.4`. In the below example, I am adding these styles in the onAdd event:

In addition, the Upload component has a showActionButtons prop which you can set to false to remove the visibility of the buttons if that matches what you need.

I hope this helps, but please let me know if you have any further questions.

Regards,
Wissam
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

David
Top achievements
Rank 1
commented on 15 May 2023, 02:10 PM

Yes!

`showActionButtons` is exactly what I was looking for! (I need it dynamically)

I actually looked inside `Upload.d.ts` in node_modules... don't know how I missed it..

Thanks!
Wissam
Telerik team
commented on 15 May 2023, 04:01 PM

You are welcome, David. I am glad that my reply was helpful to you.
Tags
Upload
Asked by
David
Top achievements
Rank 1
Answers by
Wissam
Telerik team
Share this question
or