我有 ExtJs 2.2
我在 JSP 中有这个输入:
<td class="myStyle" bgcolor="someColor"><div align="left">
<input name="myInput" type="text" id="myInput" value="" size="30" maxlength="40">
</div></td>
然后我有这个:
Ext.onReady(function(){
new Ext.form.NumberField({
allowDecimals: false,
allowNegative: false,
cls:'',
emptyClass:'',
emptyText:'',
fieldClass:'',
focusClass:'',
invalidClass:'',
invalidText:'',
disableClass:'',
grow: false,
maxLenght: 40,
applyTo: document.getElementById("myInput")
});
});
但是,它改变了输入的风格......有没有办法保留 myInput 的风格?
编辑:
昨天我还注意到,我将 Extjs 输入置于 html 输入之上!.. 所以我将 HTML 代码更改为:
<td class="myStyle" bgcolor="someColor"><div align="left" id='myInputDiv'>
</div></td>
和 extjs 代码:
Ext.onReady(function(){
new Ext.form.NumberField({
allowDecimals: false,
allowNegative: false,
cls:'',
emptyClass:'',
emptyText:'',
fieldClass:'',
focusClass:'',
invalidClass:'',
invalidText:'',
disableClass:'',
grow: false,
maxLenght: 40,
id: 'myInput',
name: 'myInput',
applyTo: document.getElementById("myInputDiv")
});
});
但是,它看起来仍然与页面中的其他输入不同