dkris
dkris

Reputation: 1280

Password Strength Implementation ExtJS

I was looking at password strength implementations with ExtJS and came across this particular implementation,

A password strength meter for passwords for ExtJS4.

This is implemented using ExtJS 4 and i was looking to use it with ExtJS 3. I tried a few options, but couldn't figure out much.

Please let me know if there is something specific i need to do in order to get it working with ExtJS 3.

Here is the Github link for this plugin if that would help.

Upvotes: 2

Views: 2144

Answers (3)

Yiyu Jia
Yiyu Jia

Reputation: 181

I modified the Ext.ux.PasswordMeter to be Ext JS 4 compatible. Here is the code: my blog

please feel free to give me feedback.

Upvotes: 2

Andron
Andron

Reputation: 6631

In several my projects I used this widget: Ext.ux.PasswordMeter

It worked well, so I think you can review it too.

Upvotes: 5

dmackerman
dmackerman

Reputation: 2966

Seems easy enough. All you would do is extend the Ext.form.TextField class with that same logic. They are processing the actual 'strength' with the onFieldChange event, which in Ext 3 doesn't exist from what I can see in the docs, but you could easily do the same with the keyup : ( Ext.form.TextField this, Ext.EventObject e ) event.

Take a look at the source and see that they define 2 functions, processValue and scorePassword. You could copy those functions directly, and then implement the keyup function to use those.

You would create the class:

    Ext.form.PasswordStrength = Ext.extend(Ext.form.TextField, {


        initComponent: function () {

           // write your code, functions, etc here

            // default values you want for your TextField
            var config = {

            }

            Ext.apply(this, config);

            Ext.form.PasswordStrength.superclass.initComponent(this);

        }
    });

   // register an xtype
    Ext.reg("passwordstrength", Ext.form.PasswordStrength);

That should be enough to get you started.

Upvotes: 4

Related Questions