PDA

View Full Version : Hyperlink in a form panel



Krishna_tgkk
12 May 2010, 10:10 AM
Hi

I have seen that this question is asked so many times but there is no straight piece of code for the same. could anyone please help me out.
Here is my code

var myRecord = Ext.data.Record.create([
{name: 'named'},
{name: 'emaild'},
{name: 'cnumberd'},
{name: 'locd'},
{name: 'bphoned'},
{name: 'bbphoned'},
{name: 'addressd'},
{name: 'deptd'},
{name: 'costcenterd'},
{name: 'mnamed'},
{name: 'titled'},
{name: 'dojd'},
{name: 'mid'},
{name: 'companyd'}
]);
var fsf = new Ext.FormPanel({
labelWidth: 200, // label settings here cascade unless overridden
reader: new Ext.data.JsonReader({
idProperty: 'id',
successProperty: 'success',
root: 'data'
},myRecord),
frame:true,
title: 'Simple Form',
standardSubmit: true,
bodyStyle:'padding:5px 5px 0',
width: 900,
buttons: [{
text: 'Back',
handler: function() {
history.back();
}

}],
items: [
{
fieldLabel: 'Manager ID',
xtype:'displayfield',
//readOnly:'true',
labelStyle: 'font-weight:bold;',
name: 'mid'
},
{
fieldLabel: 'Manager Name',
xtype:'displayfield',
//readOnly:'true',
labelStyle: 'font-weight:bold;',
name: 'mnamed'
}])};


Similalrly I have 10 more ields in this form. my requirement is very simple the manager name field value should be hyperlinked with a url and the querystring of the url is manager id.

I have tried xttype to box and using autoEl but dont know how to pass parameter for the same.

Hope I am clear in my question

Thanks
Krishna

Krishna_tgkk
12 May 2010, 12:07 PM
ok Guys i have solved my issue, please let me knwo if any best means is there but i have solved in generating required data in JSON itself. Here is the sample JSON format


{'success':true,'data':[{'id':1,'named':'NAME CHANGED','emaild':'[email protected]','cnumberd':'null','locd':'CORPORATE OFFICE','bphoned':'null','bbphoned':'null','addressd':'1411 ROAD','deptd':CONSUMER BUSINESS','mnamed':'<a href=/portal.pepcomp.finder?details=det&PR=2345>NAME CHANGED</a>','titled':'EVP AMERICA','dojd':'null','mid':'21','companyd':'xxxxxx'}]}


Thanks
Krishna