在textarea ExtJS中动态更改maxLength

时间:2018-09-13 12:45:51

标签: extjs extjs6-classic

我想为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
            }
        }

}

0 个答案:

没有答案