PDA

View Full Version : removal of comma in composite field



SAP
25 Oct 2010, 10:04 PM
How to remove comma and colon which occures due to removal of fieldlabel in composite field.please see image attach and code for more details

regards,23014



// JScript File
Application.Network = Ext.extend(Ext.form.FormPanel,
{
border:false ,initComponent:function()
{

/////// config start

var stDate = new Ext.data.SimpleStore({
fields: ['id', 'Protocol1'],
data : [['1','etho 1'],['2','etho 2']]
});

var config = {
layout:'form',
//frame:'true',
url: '../Submit.htm<#SessionID>',
width: 880,
bodyStyle:'padding:25px',
defaults: {width: 840},
labelWidth: 70,
defaultType: 'textfield',
labelAlign:'top',
defaultType: 'textfield',

items: [ {
xtype:'label',
width:'100%',
style:'margin-left:1',
formBind:true,
html: '<b>Default Route:</b>'
},{
xtype:'label',
html:'<hr/>',
width:'93.5%'
},{
xtype: 'compositefield',
//fieldLabel: 'Start Date',
items: [ {
xtype: 'displayfield',
value: 'Default Gateway:'
},
{
name : 'minutes',
xtype: 'numberfield',
width: 48,
allowBlank: false
},{
xtype: 'label',
style:'width:123',
formBind:true
}, {
xtype: 'combo',
name: 'genre',
displayField:'Protocol1',
mode: 'local',
store: stDate,
anchor:'8%'
},
{
xtype: 'label',
style:'width:43',
formBind:true
},{
xtype:'tbbutton',
text:'Update',
width:'60',
name:'update_time'
}
]
},

//-------------2-------------
{
xtype:'label',
width:'100%',
style:'margin-left:1',
formBind:true,
html: '<b>Static Route:</b>'
},{
xtype:'label',
html:'<hr/>',
width:'93.5%'
},{
xtype: 'compositefield',

labelAlign:'top',
items: [{
xtype:'numberfield',
fieldLabel: 'Destination',
name: 'Server Too Busy',
value: '',
width:'60'
},{
xtype: 'label',
style:'width:30',
formBind:true
},{
xtype:'numberfield',
fieldLabel: 'Gateway',
name: 'Server Too Busy',
value: '',
width:'60'
},{
xtype: 'label',
style:'width:30',
formBind:true
},{
xtype:'numberfield',
fieldLabel: 'Mask',
name: 'Server Too Busy',
value: '',
width:'60'
},{
xtype: 'label',
style:'width:30',
formBind:true
},

{
fieldLabel: 'Adapter',
xtype: 'combo',
name: 'genre',
displayField:'Protocol1',
mode: 'local',
store: stDate,
anchor:'10%'
},{
xtype:'tbbutton',
text:'Update',
width:'60',
name:'update_time'
}
]},
//------------------3-------------
{
xtype:'label',
html:'<hr/>',
width:'93.5%'
},{
xtype: 'compositefield',

items: [{
xtype:'textarea',
fieldLabel: 'Current Table',
name: 'Server Too Busy',
height:'100',
anchor:'-3',
width:'700'
}

]}

]
};


Ext.apply(this, Ext.apply(this.initialConfig, config));
// });

Application.EmailEventsForm.superclass.initComponent.apply(this, arguments);

} // eo function initComponent

,onRender:function()
{
// this.store.load();
Application.EmailEventsForm.superclass.onRender.apply(this, arguments);
} // eo function onRender


,submit:function()
{
this.getForm().submit
(
{
standardSubmit: true,
//url :'Default.aspx<#SessionID>',
//url :'Default.aspx',
url : this.url,
success : this.onSuccess,
failure : this.onFailure
//params:{cmd:'save'}
}
);
}
,onSuccess:function(form, action)
{
Ext.MessageBox.alert("Success","Form Submitted SuccessFully");
}

,onFailure:function(form, action)
{
Ext.MessageBox.alert("Failure","Form could not be Submitted.");
}

});

Ext.reg('Network', Application.Network);

jarrednicholls
26 Oct 2010, 5:07 PM
This is more of an issue with CompositeField than anything else. You could simply give the CompositeField a label, or you can hide the label altogether. The other option is to override CompositeField with a monkey patch so that it doesn't use the labels of the inner fields at all. If you would like to try to tackle that, it could be a good learning exercise. If not I can whip something up for you.

Jarred