View Full Version : read only field screen with tappable phone and email

8 Dec 2011, 4:26 PM
Hi guys,

I have a screen that shows a company's details. As far as I can tell, ST has no label control so I've been using textfields with readonly set to true, eg:

xtype: 'textfield',
id: 'txtAddress',
cls: "detailText",
readOnly: true,
label: 'Address'

I now want to change the phone and email fields so if the user taps them, it calls or emails that company. The only way I can find is to change the textfield to a button, eg:

xtype: 'button',
id: 'btnPhone',
//text: 'Call Now',
//callUrl: 'tel:995223423',
//contactName: 'Ben M',
handler: callPhone

(text, url etc are set dynamically later).

I then use a function that verifies and calls

window.location = button.callUrl;

Firstly, is this overkill? Is there an easier way? I found a vague reference in the docs to a urlfield, but it seems to be created for data entry/verification.

Secondly, changing the textfield to a button then eliminates the textfield's label. Do I then have to play around with creating another readonly textfield to be the label, then attempt to duplicate the other fields' labels'style, then wrap both in an hbox?

8 Dec 2011, 7:23 PM
Found it. Using a tpl with the Panel is MUCH easier.