View Full Version : How to create a hyperlink in Form Panel?
mayura
05-21-2008, 10:08 AM
Hi,
I've a very simple requirement. I need a hyper link in my Form Panel.
I've looked at several threads in Ext JS forum but none of them are providing a satisfactory solution.
Please help.
Thanks
Mayura
deanoj
05-21-2008, 10:09 AM
use the html config option in the items:
html: '<a href="#">link</a>',
ludhiana
05-21-2008, 10:18 AM
make sure you use {0}
function renderValue(value){
return String.format(
'<b><a href="#" onClick="javascript:something();javascript:return(false);">{0}</a></b>', value);
}
{header: "Price", width: 35, dataIndex: 'price', sortable: true, renderer: renderValue};
rudytheng
05-21-2008, 01:23 PM
find out what autoEl in the boxcomponent config option is.... ;)
mayura
05-22-2008, 01:15 AM
make sure you use {0}
function renderValue(value){
return String.format(
'<b><a href="#" onClick="javascript:something();javascript:return(false);">{0}</a></b>', value);
}
{header: "Price", width: 35, dataIndex: 'price', sortable: true, renderer: renderValue};
Thanks for your inputs. But I do not want to create a hyperlink in GridPanel but in FormPanel. In GridPanel it can be easily done using renderer.
shahulhameed
05-22-2008, 03:32 AM
try this...
xtype: 'box',
autoEl: { html:'<a href="">s</a>'}
mayura
05-22-2008, 04:10 AM
Hey, thanks a lot!
This worked. :D
{
xtype:'box',
autoEl: {html:'<a href="javascript:test()">Test</a>'}
}
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.