views:

615

answers:

1

So I'm using ExtJS for a job I'm working and I'm trying to dynamically populate the textarea associated with the HTML editor with data based on what a user selects from a combo box. From what I've found, I can load the HTML editor with text using the defaultValue property. So if I'm going to populate it after the page loads, can I give it something like a datastore or is there a method I can call to set the text?

A: 

Just call foo.setValue("bar");, like with all form inputs.
http://www.extjs.com/deploy/dev/docs/source/Field.html#method-Ext.form.Field-setValue
http://www.extjs.com/deploy/dev/docs/?class=Ext.form.HtmlEditor

Sean Kinsey
I assume thats only if I am rendering the HTML editor to an existing textarea defined in HTML, which I am not. Everything is "pure" ExtJS and it's being placed inside a FormPanel.Code --> http://pastebin.com/PeEDerB7
There's no differences in the API for the two scenarios. `.setValue` works either way. But you really want to use `value:` and not `defaultValue:`. defaultValue has a different meaning for the HTMLEditor
Sean Kinsey
Btw, why would you assume such a thing?
Sean Kinsey