PDA

View Full Version : How to populate dynamic text from xmlreader into label



gujind
20 Feb 2009, 3:37 PM
I'm trying to read xmlreader's value into label, but don't know how to do it :-?

tryanDLS
20 Feb 2009, 3:43 PM
Please read http://extjs.com/learn/Ext_Forum_Help

Have you written any code, or do expect someone to just give it to you?

Show what you have so far. If you can't show that you're reading data into a xmlreader and displaying a textfield, you're not going to get much help.

If you don't understand how to get a value from the xmlreader, I suggest you spend some time reading the API and also the grid FAQ.

gujind
20 Feb 2009, 3:49 PM
I'm trying with following code.


var testForm = new Ext.FormPanel({

id: 'test',
frame: true,
labelAlign: 'left',
title: 'Test',
bodyStyle:'padding:5px',

reader : new Ext.data.XmlReader({
record : 'test_info',
success: '@success'
},
[
'param1','param2','param3'
]),

errorReader: new Ext.form.XmlErrorReader(),

items: [{

xtype: 'fieldset',
defaults: {width: 180}, // Default config options for child items
defaultType: 'textfield',
autoHeight: true,

border: false,

items: [{
fieldLabel: 'Test1',
name: 'param1',

},{
fieldLabel: 'Action',
name: 'param2',

},
{
xtype: 'label',
name: 'param3',

}
]
}],

});

testForm.load({
url:'somefile.php',

waitMsg:'Loading'});

gujind
20 Feb 2009, 4:04 PM
In above code I'm not sure how to read variable for xtype:label.

Condor
20 Feb 2009, 11:51 PM
So you want to display static loaded info? I would recommend using a read-only field or a StaticTextField (user extension).