TinyMCE is not included in the inputEx distribution !
Download it on http://tinymce.moxiecode.com/ (tested with version 3.3.7) and install it in lib/tiny_mce
Use the following code to create a basic inputEx TinyMCEField.
1 | new inputEx.TinyMCEField({parentEl: 'container1', name: 'rteField', value: String.fromCharCode(60)+"b"+String.fromCharCode(62)+"I'm"+String.fromCharCode(60)+"/b"+String.fromCharCode(62)+" the default value. I've been set through the value option."}); |
view plain | print | ? |
Test for setValue/getValue using the TinyMCEField.
1 | var div = YAHOO.util.Dom.get('container2'); |
2 | var htmlField = new inputEx.TinyMCEField({parentEl: div, name: 'test2'}); |
3 | |
4 | var button1 = inputEx.cn('button', null, null, "SetValue"); |
5 | div.appendChild(button1); |
6 | YAHOO.util.Event.addListener(button1, "click" ,function() { |
7 | htmlField.setValue('TinyMCEField can contain HTML !'); |
8 | }); |
9 | var button2 = inputEx.cn('button', null, null, "GetValue"); |
10 | div.appendChild(button2); |
11 | YAHOO.util.Event.addListener(button2, "click" ,function() { |
12 | alert(htmlField.getValue()); |
13 | }); |
view plain | print | ? |
Use the following code to create a SimpleEditor widget
1 | var field3 = new inputEx.TinyMCEField({parentEl: 'container3', name: 'rteField3'}); |
2 | field3.setValue("Value set just after init..."); |
view plain | print | ? |
You can have access to all the tinymce config options through the "opts" attribute. Check out the TinyMCE examples for all options.
1 | var field4 = new inputEx.TinyMCEField({ |
2 | parentEl: 'container4', |
3 | name: 'rteField4', |
4 | |
5 | opts: { |
6 | mode : "textareas", |
7 | //language : "fr", |
8 | height: "400", |
9 | width: "400" |
10 | } |
11 | }); |
12 | field4.setValue("Value set just after init..."); |
view plain | print | ? |