在文本区域 ExtJS 中动态更改 maxLength
Change maxLength dynamically in textarea ExtJS
我想动态更改 textarea 的 maxLength。
我试过这个:
{
xtype: 'textareafield',
msgTarget: 'under',
fieldLabel: __('text_sms'),
maxLength: 60,
name: 'text-sms',
bind: {
value: __('sms_text_template'),
afterSubTpl: '<span>{length}/{maxLength}</span>'
},
listeners: {
change: function (el) {
el.setMaxLength(60); // error is not a function
}
}
}
我还尝试绑定值 maxLength:
bind: {
value: __('sms_text_template'),
maxLength: '{maxLength}'
},
我想动态更改 textarea 的 maxLength。 我试过这个:
{
xtype: 'textareafield',
msgTarget: 'under',
fieldLabel: __('text_sms'),
maxLength: 60,
name: 'text-sms',
bind: {
value: __('sms_text_template'),
afterSubTpl: '<span>{length}/{maxLength}</span>'
},
listeners: {
change: function (el) {
el.setMaxLength(60); // error is not a function
}
}
}
我还尝试绑定值 maxLength:
bind: {
value: __('sms_text_template'),
maxLength: '{maxLength}'
},