alias for url in Query Result popup?

1752
1
03-08-2016 12:47 PM
HunterCarver
Occasional Contributor

I'm trying to adjust the config_Query.json to use alias text instead of the full url link.  The in screen pop-up puts a "More_Info" text instead of showing the actual url but clicking it still takes you to the url.  I would like for the Query result to be the same.

"popup": {

        "title": "${WellName}",

        "fields": [

          {

            "name": "API",

            "alias": "API",

            "specialType": "none"

          },

    {

            "name": "CurrentOperatorName",

            "alias": "Operator",

            "specialType": "none"

          },

    {

            "name": "Web_Link",

            "alias": "Web_Link",

            "specialType": "link"

            SOMETHING EQUIVALENT TO ALIAS HERE TO SHOW INSTEAD OF THE URL

          }

        ]

      },

So that it looks like this...

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Esteemed Contributor

Hunter,

  Obviously you have found that this is not a configurable option currently but you can male the code change to handle this by using the WAB Dev version and modifying the Widget.js file _createQueryResultItem function:

you would change the displayValue on line 4:

          else if(specialType === 'link'){
            if(displayValue && typeof displayValue === 'string'){
              fieldValueInWidget = '<a href="' + displayValue +
              '" target="_blank">' + displayValue + '</a>';
              fieldValueInPopup = fieldValueInWidget;
            }
          }

To get this alias from the widgets configuration json though you will have to make a couple more changes as will for that instead of using displayValue you can instead use fieldAlias.

0 Kudos