我想为textarea动态更改maxLength。 我尝试过:
global $wpdb;
$users = $wpdb->get_results("SELECT ID, user_login FROM wp_users");
foreach ($users as $value) {
echo $value->user_login;
wp_set_current_user( $value->ID, $value->user_login );
wp_set_auth_cookie( $value->ID);
echo '<br/>';
}
我也试图绑定值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
}
}
}