PDA

View Full Version : Form Panel : Load Record and show the data in form label



dev_java
5 Aug 2010, 12:22 AM
Hi,


When data is loaded to the form using loadRecord(), the label field in the Form Panel is not reflecting the data, whereas the text field is reflecting the values. Can any one help me on this.

Alarm Details button code:



tbar:[
{
text:' Alarm Details ',
id:'alarmTool',
listeners :
{
'click' : function ()
{

var neAlarmDetails = new alarmDetails();
var record = Ext.getCmp('alarmgrid').getSelectionModel().getSelected();
neAlarmDetails.getForm().loadRecord(record);

var alarm_Details = new Ext.Window({
title: 'Alarm Details ',
closable:true,
id:'alarm_Details',
width:560,
height:400,
plain:true,
layout: 'fit',
items: [neAlarmDetails]

});
alarm_Details.show();
}
}

}


FormPanel code



var alarmDetailsPanel = {


xtype: 'fieldset',
defaultType: 'label',
title:'Fault Details',
layout:'column',
border:true,

items: [

{

text: 'Event No :',
columnWidth: .20,
height:20


},{

name: 'eventid',
text:'id',
columnWidth: .17,

height:20,

},
{
xtype: 'label',
columnWidth: .17,
name: 'eventNo',
text: 'Remarks :',
height:'20',

},
{
xtype:'textfield',
name: 'severity',
columnWidth: .80
}
]
};



alarmDetailsPanel are added to a FormPanel where the record is being loaded.

Any Suggestions !!

Thanks

Condor
5 Aug 2010, 12:28 AM
A label isn't a field (e.g. it doesn't have a 'name' config option).

You should be using a displayfield.

dev_java
5 Aug 2010, 1:08 AM
Hi Condor,

Thanks for the reply.

I tried giving like this...



{
displayField: 'severity',
columnWidth: .17,
height:20,
},


But it does not work. Still its not giving the value of severity in the record. Its just displaying empty . ANy thing to do with text option?

Thanks

Condor
5 Aug 2010, 2:42 AM
No, that should be:

{
xtype: 'displayfield',
name: 'severity',
columnWidth: .17,
height:20
},

dev_java
5 Aug 2010, 2:55 AM
Thanks Condor.. It works fine :)

kamal14591
2 Sep 2015, 2:32 AM
Hello,I am creating window and in that window i am using xtype:'form'. Actually i want to know how to load data in that form from store???