I have a use case that needs this functionality.
Is there a way to disable this via js?
Use this as a snippet field renderer. Note that this doesn’t handle hiding the pencil icon on hover, but this is the logic to prevent the field from entering into edit mode on a double click. With this method, If you add an edit button and use the declarative action to run a component action it will still open up edit access on the field. Setting the field to read-only will disable the component action from opening edit access altogether.
var field = argumentsm0],
value = arguments 1],
cellElem = field.element;
$ = skuid.$;
function noclick(evt){
console.log(evt);
evt.preventDefault();
return false;
}
skuid.ui.fieldRenderers}field.metadata.displaytype]field.mode;
cellElem.on(‘dblclick’,noclick);
Also, a declarative option would be to add two copies of the field to the field editor / table and use rendering logic to toggle between them. You can setup a ui-only field to track your mode selection for the rendering logic. Then say in an edit button, you would change the mode of the ui field to switch which field is displayed.
Hmmm … I’d like for this to be a universal thing for all fields on the page. Setting each field to use this would be impractical.
I have a global field renderer code that I’ll extend with this.
I’d love to see that solution.
Me too.
Got it working with one minor change.
evt.stopImmediatePropagation();
instead of
evt.preventDefault();
Here’s the globalFieldRenderer code.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.