PDA

View Full Version : Setting html inside a panel from a function



m4manas
20 Jan 2012, 10:34 AM
<code>
var panel = new Ext.form.FormPanel({

xtype: 'fieldset',
id: 'tweetFieldset',
title: 'Tweet Reply',
items:[{
items: [{
id: 'tweetMessage',
xtype: 'panel',
html: "tweet"
}, {
xtype: 'textareafield',
name: 'tweetReply',
}]
}, {
items: [{
id: 'replyTweetButton',
xtype: 'button',
width:'150',
ui: 'confirm-round',
text: 'Reply',
handler: this.onTweetReply,
scope: this
}]
}]

});
</code>

I want to change the html value of the tweetMessage panel from a function. I m trying to do
Ext.getCmp('tweet').setValue('new tweet');
But it does not works.

Any suggestions

mitchellsimoens
20 Jan 2012, 11:21 AM
What field has the id 'tweet'? If you want to put html inside a panel then use update() on the panel.

m4manas
20 Jan 2012, 11:25 AM
Thanks, it works.

Sencha Rocks!!