Option to disable double click to edit when Mode is set to Read with Inline-Editing

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 = arguments[0],    
    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. :wink:

Got it working with one minor change.

evt.stopImmediatePropagation();
instead of
evt.preventDefault();

Here’s the globalFieldRenderer code.