PDA

View Full Version : HTML Hyperlink in Textfield



webskipper
25 Apr 2012, 5:03 AM
Hi,

is it possible to set a html link within a xtype: textfield ?

Should I use setRawValue (http://docs.sencha.com/ext-js/3-4/#!/api/Ext.form.Field-method-setRawValue)( Mixed value ) ?

scottmartin
30 Apr 2012, 2:34 PM
I believe you will have to use fieldLabel



xtype: 'fieldLabel',
html: '<link>'


Regards,
Scott

sword-it
8 May 2012, 2:26 AM
Hi Webskeeper,

Instead of using textfield , you should use 'box'.Code is given below with output.



{
xtype: 'box'
, fieldLabel: 'Google'
, name: 'google'
, html:'<a href="www.google.com" target="_blank">Google</a>'
}



Output:-

34984

Hope it will works for you...

Have a nice day!!!!!

webskipper
8 May 2012, 4:14 AM
Thank you, but I want to fill the textfield after it is edited.

My idea is to combine a key = ENTER listener with a auto-fill / renderer.

sword-it
8 May 2012, 4:32 AM
Hi Webskipper,

It's not possible to make it with a single textfield component as you can not set any link in the textfield's value .

However, you should create two different components here, one of them is textfield and the other one is a box.

Whenever you hovers on the link (box), there should be link/button says EDIT appears, and when you hits on the edit button, textfield should be visible with the editable content like <a>google.com</a>.

And when You hits the enter, it should be turn into box showing exactly the html content that has been provided by you in the textfield.

Hope it will works for you!!!

Have a nice day!!!