Note the need to introduce kindeditor related resources
1 //WYSIWYG Editor2Ext.define (' Ux.form.field.KindEditor ', {3Extend: ' Ext.form.field.TextArea ',4Alias: ' Widget.kindeditor ',5Xtype: ' Kindeditor ',6 //Maximum text length7maxlength:5000,8 //Configuration9 editorconfig: {Ten //Options Feature One items: [ A' Source ', ' | ', ' undo ', ' Redo ', ' | ', ' preview ', ' cut ', ' copy ', ' Paste ', ' plainpaste ', ' wordpaste ', ' | ', ' justifyleft ', ' jus Tifycenter ', ' justifyright ', ' justifyfull ', ' insertorderedlist ', ' insertunorderedlist ', ' Indent ', ' outdent ', ' Subscript ', ' superscript ', ' clearhtml ', ' Quickformat ', ' selectall ', ' | ', ' fullscreen ', '/', - -' Formatblock ', ' fontname ', ' fontsize ', ' | ', ' forecolor ', ' hilitecolor ', ' bold ', ' italic ', ' underline ', ' strikethrough ', ' Lineheight ', ' removeformat ', ' | ', ' image ', ' table ', ' hr ', ' emoticons ', ' pagebreak ', ' anchor ', ' link ', ' unlink ', ' | ', ' ABO Ut the ], -minheight:200 - }, -AfterRender:function () { + varme = This; - me.callparent (arguments); + //deferred input validation AMe.task = ext.create (' Ext.util.DelayedTask '), at function(t) { - me.isvalid (); - }, - me); - if(!me.editor) { - //Create a Rich text plugin inMe.editor = Kindeditor.create ("#" +Me.getinputid (), ext.apply (Me.editorconfig, { - //Editor created successfully toAftercreate:function () { + //Identity Complete -Me. Kindeditorisready =true; the }, * //when the content has changed $AfterChange:function () {Panax Notoginseng //Editor initialization completed before execution - if(me.) Kindeditorisready) { the //deferred input validation +Me.task.delay (100); A } the }, + //Lose Focus -Afterblur:function () { $ //Input Validation $ me.isvalid (); - } - })); the}Else { - me.editor.html (Me.getvalue ());Wuyi } the }, -SetValue:function(value) { Wu //console.log (' SetValue '); - varme = This; About if(!me.editor) { $ Me.setrawvalue (Me.valuetoraw (value)); -}Else { - if(value) { - me.editor.html (value.tostring ()); A}Else{ + the } - } $ me.callparent (arguments); the returnMe.mixins.field.setValue.call (Me, value); the }, theGetrawvalue:function () { the //console.log (' Getrawvalue '); - varme = This; in if(me.) Kindeditorisready) { the //Auto Sync values the Me.editor.sync (); About } thev = Me.inputel? Me.inputEl.getValue (): "; theMe.rawvalue =v; the returnv; + }, - // Reset theResetfunction () {Bayi if( This. Editor) { the This. editor.html ("); the } - This. Callparent (); - }, the //destroying Rich text controls theDestroyeditor:function () { the varme = This; the if(me.rendered) { - Try { the Me.editor.remove (); theMe.editor =NULL; the}Catch(e) {}94 } the }, the //destroyed theOnDestroy:function () {98 varme = This; About me.destroyeditor (); - me.callparent (arguments);101 }102});
Ux.form.field.KindEditor WYSIWYG Editor