If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#52177 by kklosson
Wed Nov 27, 2019 1:56 am
The widget that displays a document attribute has a delete button on it and my users are always hitting it and deleting the document. I have no need for the delete function. Can anyone offer a script to hide it?

Screenshot_1.png
Screenshot_1.png (7.81 KiB) Viewed 1209 times
#52184 by johntalbott
Fri Nov 29, 2019 12:46 am
This should work, but it looks like there is a typo.
$("[title|='Remove']").hide();

This will work
$("[title ='Remove']").hide();

It likely doesn't matter as the human eye can't tell the difference, but the options below use a jQuery selector that is a little more specific which in theory will perform better. ...

Hide the button with the X
$("button.k-upload-action[aria-label='Remove']").hide()

Remove the button with the X from the DOM altogether.
$("button.k-upload-action[aria-label='Remove']").remove()
#52188 by Jaymer
Fri Nov 29, 2019 2:26 am
(see post at top of thread for specific case)
Put either in the Render Script of the Form (not Section)

Hide the button with the X
$("button.k-upload-action[aria-label='Remove']").hide()

Remove the button with the X from the DOM altogether.
$("button.k-upload-action[aria-label='Remove']").remove()

--> JaymerTip (example code from John Talbott)
Last edited by Jaymer on Fri Nov 29, 2019 4:45 pm, edited 1 time in total.
#52192 by idpSteve
Fri Nov 29, 2019 6:36 am
The | is unnecessary but won't break anything.

All it does is select elements whose title equals 'Remove' or starts with 'Remove-' similar to how a * or ^ works.

I copied it from some other code which is why the | was there.

Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 17 guests