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?
Hide delete button on document widget
Hide delete button on document widget
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
MySQL, AWS EC2, S3
PDFtk Toolkit
Re: Hide delete button on document widget
Try this in the render script:
$("[title|='Remove']").hide();
$("[title|='Remove']").hide();
Re: Hide delete button on document widget
Much appreciated but no joy. Should this not be a statement like config.something?
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
MySQL, AWS EC2, S3
PDFtk Toolkit
Re: Hide delete button on document widget
Surely you can use PROTECT in some way, to manage this event ?no need for the delete function
Re: Hide delete button on document widget
Users need to download the current form, complete it, and re-upload it. So must have read/write authority.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
MySQL, AWS EC2, S3
PDFtk Toolkit
-
- Posts: 619
- Joined: Wed Jun 17, 2015 11:16 pm
- Location: Omaha, Nebraska
- Contact:
Re: Hide delete button on document widget
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()
$("[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()
VocalDay Solutions - Agility - Predictability - Quality
We specialize in enabling business through the innovative use of technology.
AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
We specialize in enabling business through the innovative use of technology.
AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
Re: Hide delete button on document widget
Sadly, none of these options are working. Do these go in the initialization script of the attribute?
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
MySQL, AWS EC2, S3
PDFtk Toolkit
Find Object on Form, Hide or Remove It
(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)
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.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: Hide delete button on document widget
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.
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.
Re: Hide delete button on document widget
Got it. Works perfectly. Thanks to all.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
MySQL, AWS EC2, S3
PDFtk Toolkit