dijit » _InlineEditor » postCreate
dijit._InlineEditor.postCreate
dojo.require("dijit.InlineEditBox");
defined in dijit/InlineEditBox.js
Usage
function () (view source)
var cls = dojo.getObject(this.editor); var ew = this.editWidget = new cls(this.editorParams, this.editorPlaceholder); // Copy the style from the source // Don't copy ALL properties though, just the necessary/applicable ones var srcStyle = this.style; dojo.forEach(["fontWeight","fontFamily","fontSize","fontStyle"], function(prop){ ew.focusNode.style[prop]=srcStyle[prop]; }, this); dojo.forEach(["marginTop","marginBottom","marginLeft", "marginRight"], function(prop){ this.domNode.style[prop]=srcStyle[prop]; }, this); if(this.width=="100%"){ // block mode ew.domNode.style.width = "100%"; // because display: block doesn't work for table widgets this.domNode.style.display="block"; }else{ // inline-block mode ew.domNode.style.width = this.width + (Number(this.width)==this.width ? "px" : ""); } this.connect(ew, "onChange", "_onChange"); // Monitor keypress on the edit widget. Note that edit widgets do a stopEvent() on ESC key (to // prevent Dialog from closing when the user just wants to revert the value in the edit widget), // so this is the only way we can see the key press event. this.connect(ew.focusNode || ew.domNode, "onkeypress", "_onKeyPress"); // priorityChange=false will prevent bogus onChange event (this.editWidget.setDisplayedValue||this.editWidget.setValue).call(this.editWidget, this.value, false); this._initialText = this.getValue(); if(this.autoSave){ this.buttonContainer.style.display="none"; }