2

I'm trying to add a mixin to our ValidationTextBox using data-dojo-mixin="_MaskedMixin" in the html attribute for use when the parser runs over my document. When I do this, the instance gets an id of "_MaskedMixin_0" instead of "ValidationTextBox_0".

Is there any way to preserve the "ValidationTextBox" identity of the mixed in object?

4

1 回答 1

3

Not knowing your particular case, my recommendation would be to specify the id in the HTML markup and not let the parser auto generate one. But if you want the id to be auto generated, you can override the declared class.

http://jsfiddle.net/cswing/EQj8G/

<input type="text" data-dojo-type="dijit/form/ValidationTextBox" 
    data-dojo-mixins="_MaskedMixin" 
    data-dojo-props="declaredClass:'ValidationTextBox'" 
    value="" ></input>
于 2013-02-07T17:03:27.810 回答