ExtJs - 动态更改Textfield VType [英] ExtJs - Change Textfield VType dynamically

查看:152
本文介绍了ExtJs - 动态更改Textfield VType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个很简单的问题。没有任何地方找到答案。

A rather straightforward question. No answer found anywhere.

使用ExtJs 4.2

Using ExtJs 4.2

我有两个自定义VTypes和一个文本字段。我想在用户单击单选按钮时更改该文本框的vtype。

I have two custom VTypes, and one textfield. I want to change that textfield's vtype when the user clicks a radio button.

我知道文本字段已经被创建了:

I know that the text field has already been created so doing:

textfield.vtype = 'otherType';

不会为我做。也不会:

Ext.apply(textField,{vtype:'otherType'});  

所以明显的东西是出来的。现在我正在摧毁和重新创建它,但是(如果它甚至起作用)似乎过度杀伤。

So the obvious stuff is out. Now I'm toying with destroying and re-creating it, but (if it even works) that seems like overkill.

推荐答案

使用Ext.apply为我工作,在这里提起: https://fiddle.sencha.com/#fiddle/4d4

Using Ext.apply worked for me, fiddle here: https://fiddle.sencha.com/#fiddle/4d4

希望这有帮助..

这篇关于ExtJs - 动态更改Textfield VType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆