Created
April 13, 2011 12:03
-
-
Save Kalyse/917419 to your computer and use it in GitHub Desktop.
Allow a dijit to be focusable in a Textbox. (Yes I know that dijit.grid.cells._Widget and _Base exists exactly for this purpose, but I wanted to do it without doing that).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
formatCurrency: function(value, idx){ | |
if(!this._widgets[idx]){ | |
this._widgets[idx] = new dijit.form.TextBox( | |
{ value: value, | |
constraints: {pattern:"#,###,###.00"} | |
}); | |
this._widgets[idx]._connection = dojo.connect(this._widgets[idx], "onFocus", function(e,f,g){ | |
setTimeout(dojo.hitch(this,function(){ | |
dojo.disconnect(this._connection); | |
dojox.grid.util.fire(this,"focus"); | |
}),90); | |
} ); | |
this._widgets[idx]._connection = dojo.connect(this._widgets[idx], "onBlur", function(e,f,g){ | |
this._widgets[idx]._connection = dojo.connect(this._widgets[idx], "onFocus", function(e,f,g){ | |
setTimeout(dojo.hitch(this,function(){ | |
dojo.disconnect(this._connection); | |
dojox.grid.util.fire(this,"focus"); | |
}),90); | |
} ); | |
} ); | |
} | |
return this._widgets[idx]; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment