Idea: reference field on click options

edited June 25, 2020 in Ideas
Each reference field in field rendered or tables or decks could have five on-click options: 1) open in current window 2) open in new window 3) open in popup 4) open in sliding panel 5) do nothing
6
6 votes

Awaiting Review Β· Last Updated

Comments

  • Bill McCulloughBill McCullough πŸ’ŽπŸ’Ž
    edited July 8, 2017
    Raymond,

    Up vote here. Β Especially the 'do nothing' option.

    Thanks,

    Bill
  • edited October 15, 2019
    Similar concept with email fields and hyperlink fields would be nice.Β 
    Open in current window
    Open in blank window
    Open in Javascript popup
    Open as mailto

  • Amy DewaalAmy Dewaal ✭✭
    edited June 5, 2018
    Raymond and Bill,

    Did you guys know that you can control where a reference field links to as of the Brooklyn Q2 release? You can click on a reference field and view the Link tab and decide if it links to the data source default, no link, or custom url (and within custom url you can decide if it opens in a new tab or the current window). You might have made this post because you wanted to extend that functionality, but I wanted to let you know about it just in case (I didn't notice it as a new feature until just the other day!) :)
  • Bill McCulloughBill McCullough πŸ’ŽπŸ’Ž
    edited June 5, 2018
    Amy,

    Thanks for letting us know. Β I know that I did not know of this feature until your post. Β I am not sure about Raymond.

    Thanks again!

    Bill
  • edited June 5, 2018
    Hi Amy,Β 

    I am using the "Custom URL" and "Open in new tab" options for this, which is great. I however ran into the issue that I would like to pass on a page parameter in my custom URL, and the ampersand (&) gets rewritten to "&", breaking my link to the Skuid page :-(Β  Any way around this?

    Many thanks in advance,Β 

    Robin
  • edited June 17, 2018
    Is anybody able to get around the ampersands getting recoded to "&", breaking the links?
  • Bill McCulloughBill McCullough πŸ’ŽπŸ’Ž
    edited June 17, 2018
    Robin,

    Try wrapping your URL with the 'urlDecode' merge.Β  Like this....
    {{#urlDecode}}/apex/skuid__ui?page=AccountDetailTest&id={{{AccountId}}}{{/urlDecode}}
    Thanks,

    Bill
  • edited June 17, 2018
    Bill delivers the goods yet again. Simple and flawless solution, all of my thumbs up!

    Much appreciated,Β 

    Robin
  • edited October 15, 2019
    From Amy Dewaal: Did you guys know that you can control where a reference field links to as of the Brooklyn Q2 release? You can click on a reference field and view the Link tab and decide if it links to the data source default, no link, or custom url (and within custom url you can decide if it opens in a new tab or the current window). You might have made this post because you wanted to extend that functionality, but I wanted to let you know about it just in case (I didn't notice it as a new feature until just the other day!) :)
  • Pat VachonPat Vachon πŸ’ŽπŸ’ŽπŸ’Ž
    edited June 25, 2020
    Another option is to have inline js to make all ref fields open in a new tab by default. It's otherwise a pain to find each iteration and set this way. I like copy/paste better. ;)
    (function(skuid){      var $ = skuid.$;            // curry tastes good and is good for you too      var curry = function( func ) {          // the first parameter to this function is the function we are going to call          // so we strip it off to get the remaining parameters          var args = Array.prototype.slice.call(arguments, 1);                    // curry returns a function itself          return function() {              // when the function that was returned is called, we merge any parameters              // that were passed originally to curry (minus the first param which was the function              // itself) with any parameters that are being passed to this function              // this allows us to support skuid adding parameters in the future and it              // not impacting our renderer wrapper - Told you curry was good :)              return func.apply(this, args.concat(Array.prototype.slice.call(arguments)));          };      };             // get shorthand to the stock skuid field renderers      var fieldRenderers = skuid.ui.fieldRenderers,          REFERENCE = fieldRenderers.REFERENCE,          originalRef = {              read: REFERENCE.read              , readonly: REFERENCE.readonly              , edit: REFERENCE.edit          };              var refRenderer = function(mode, field, value) {          // mode is in arguments[0] - we're using the named parameter          // field is in arguments[1] - we're using the named parameter          // value is in arguments[2] - we're using the named parameter          // in this case, we aren't following the curry principles entirely          // if we were we would pass the full paramater chain to the calling function          // but we're using curry to insert a first param and allow the remaining          // parameters to by dynamic.  So, to make skuid think we didn't do anything          // we need to strip back off our first param and pass the remaining          // parameters to the original renderer                      var origArgs = Array.prototype.slice.call(arguments, 1);                    // invoke the original renderer                  originalRef[mode].apply(this, origArgs);                    $('a',field.element).attr("target", "_blank");                };            // our wrapper renderer that contains the logic for which renderer to actually invoke      // this allows the specific renderers themselves to be single purposed      var customRefRenderer = function(mode, field, value) {              refRenderer.apply(this, arguments);      };            // we need way within the renderer to know which mode we should use      // we can't rely on field.mode because underneath, skuid directly invokes      // READ from READONLY.  However, since we have replaced the originals, we      // end up in a recursive loop calling back in to READONLY on the original      // because field.mode is READONLY.  Sine we made some curry we'll add      // a little custom renderer wrapper sauce to it and mmmmm, yummy!      REFERENCE.read = curry(customRefRenderer, 'read');      REFERENCE.readonly = curry(customRefRenderer, 'readonly');      REFERENCE.edit = curry(customRefRenderer, 'edit');   })(skuid);
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!