Skip to content

problem with formatter in identify  #675

@shshwang

Description

@shshwang

I was following the cmv doc to add url links for one identify field. But it seems the formater function was not executed. The alert doesn't even show up. The popup window still shows the label and field value but no link. Any idea why it is so? I downloaded cmv 1.3.4 a year ago. Is it possible that I might miss some functions or module in order to use formater? Thank you so much for your help!
Cadastral: {
0: {
title: 'Parcel Information',
fieldInfos: [{

               fieldName: 'Tax ID',
               label: 'Tax ID',
               visible: true,
               formatter: function (value, attributes) {
                   alert('value');
                   var FBLink = "http://fbcad.org/Property-Search-Results?searchtext=";
                   var MLink = "http://mcad-tx.org/Property-Search-Result?searchtext=";
                   var HLink = "http://www.hcad.org/records/outsider/hc.asp?acct=" + value;
                   alert(HLink);

                   if (value.includes("R")) {

                       MLink += value;
                       return '<a href="' + MLink + '"target="_blank">{Tax ID}</a>';
                   }
                   else if (value.includes("-")) {
                       FBLink += value.replace("-", "");
                       return '<a href="' + FBLink + '"target="_blank">{Tax ID}</a>';
                   }
                   else {
                       HLink += value;
                       return '<a href="' + HLink + '"target="_blank">{Tax ID}</a>';
                   }

               }
           }]

       }
   },

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions