Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Custom item on DynamicForm. Correct method to run a JS code?

    Hi,

    I am creating a custom item for a DynamicForm. This is an item like fckeditor with a few differences. The problem, is that i can create the <textarea> ( using getInnerHTML ) but i am not able to run the javascript to create the editor.

    Example:

    Code:
    var oEdit1 = new InnovaEditor("oEdit1");
    
    isc.defineClass("DynTextEdit","TextItem").addProperties({
    	  getInnerHTML : function () {
    	  	console.log( 'getInnerhtml call' );
    		return "<textarea STYLE='width:100%;height:100%' ID=" + this.getID() + "_ta></textarea>";
    	  },
    
    
    	  loadEditor: function() {
    	  	console.log( 'loadEditor call' );
    	  	if ( document.getElementById(this.getID() + "_ta") != null) {
    	  		console.log( 'loadEditor run' );
    		  	oEdit1.features=["FullScreen","Preview","Print", "Search","SpellCheck",
    			                 "Table","Guidelines","Absolute",
    			                 "Form","Characters","ClearAll","XHTMLSource","BRK",
    			                 "Cut","Copy","Paste","PasteWord","PasteText",
    			                 "Undo","Redo","Hyperlink","Bookmark","Image",
    			                 "JustifyLeft","JustifyCenter","JustifyRight","JustifyFull",
    			                 "Numbering","Bullets","Indent","Outdent", "LTR","RTL",
    			                 "Line","RemoveFormat","BRK",
    			                 "StyleAndFormatting","TextFormatting","ListFormatting",
    			                 "BoxFormatting","ParagraphFormatting","CssText","Styles",
    			                 "CustomTag","Paragraph","FontName","FontSize",
    			                 "Bold","Italic","Underline","Strikethrough", "Superscript","Subscript",
    			                 "ForeColor","BackColor"];
    			oEdit1.useTab = false;
    		    	oEdit1.REPLACE(this.getID() + "_ta");
    	    	}
    	  },
    
    			
    	   getValue : function () {
    	        this.loadEditor();
    	        
    	        return this.value;
    	   }
    });

    As you might see, there are some console.log calls for Firebug. All of them are run except "loadEditor run" because loadEditor is called ( via getValue ) before getInnerHTML.

    What is the correct method to override in order to run loadEditor after getInnerHTML?

    Thank you.
Working...
X