change UI element based on service data
I have a grid, which is generated by a service. I map the service response to the grid.
In the grid, there is a label. But depending on what data the grid receives, it should show either just plain text, or a link.
Basically: the service returns a list of contactdetails, for example an emailaddress, next a telephonenumber, next a streetaddress.
In the "edit js" section of the list i have: $('[dsid=lblCommunicatieValue]', element).text(value);
How can i change the label to a link, or make the text on the label appear as a link if i get a telephonenumber? Should be something like a href='tel:'0456654' . But I can not set this as the label text, because then it shows as plaintext.
Can I dynamically delete the label and add a link instead, only if the value is a telephone number?