PDA

View Full Version : How to load textfield value from xml



dusoo
23 Feb 2011, 3:19 AM
Hi,
could you please help me how can I put a value from xml into a textfield on button click ?
Thanks a lot!
D.



var tb = new Ext.Toolbar({
renderTo: 'toolbardiv',
height: 35,
items: [new Ext.Button({
id: 'btn',
text: 'Click on ME',
handler: function() {
//...
}
}), '-', {
xtype: 'textfield',
emptyText: 'magic number...',
name: 'first',
width:100
}
]
});

Condor
23 Feb 2011, 4:06 AM
You'll have to do an Ext.Ajax.request for the XML data and use Ext.DomQuery to extract the value.

(local file system is not supported - only works if you host this on a HTTP server)

dusoo
23 Feb 2011, 6:01 AM
thanks, I'll give it a try.