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

Pat VachonPat Vachon ๐Ÿ’Ž๐Ÿ’Ž๐Ÿ’Ž
edited June 25 in Ideas
I have a use case that needs this functionality.

Is there a way to disable this via js?
1 votes

Awaiting Review ยท Last Updated


  • edited June 25
    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;
    ย  ย  }
  • edited July 2018
    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.ย ย 
  • Pat VachonPat Vachon ๐Ÿ’Ž๐Ÿ’Ž๐Ÿ’Ž
    edited July 2018
    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.
  • edited July 2018
    I'd love to see that solution.
  • Pat VachonPat Vachon ๐Ÿ’Ž๐Ÿ’Ž๐Ÿ’Ž
    edited July 2018
    Me too. ;)
  • Pat VachonPat Vachon ๐Ÿ’Ž๐Ÿ’Ž๐Ÿ’Ž
    edited August 2018
    Got it working with one minor change.

    instead of

    Here's the globalFieldRenderer code.
Sign In or Register to comment.