Hybrid View

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Location
    Toronto
    Posts
    62
    Vote Rating
    1
    thomsonzh is on a distinguished road

      0  

    Default how to show password by click button

    how to show password by click button


    Hi,

    I created a pop win for changing user password. How can I do if I want to show hidden password by click a button. It means how can I change inputType by code.

    code below,

    items: [{
    fieldLabel: "Login ID",
    name: "txtLoginID",
    allowBlank: false,
    anchor: '100%',
    disabled: true
    }, {
    fieldLabel: 'Old Password',
    allowBlank: false,
    name: 'txtOldPassword',
    inputType:"password",
    anchor: '100%' //
    }
    , {
    fieldLabel: 'New Password',
    allowBlank: false,
    name: 'txtPassword',
    //inputType:"password",
    anchor: '100%' //
    }, {
    xtype: 'textarea',
    fieldLabel: 'Comments',
    allowBlank: false,
    name: 'txtDescription',
    height: 80,
    anchor: '100%' //
    }]

    }]

    Many thanks
    Thomson

  2. #2
    Sencha User
    Join Date
    Apr 2007
    Posts
    172
    Vote Rating
    1
    medusadelft is on a distinguished road

      0  

    Default


    I'm looking for something similair but only for Ext 4.
    It doesn't seem possible without hiding the current field and showing another normal textfield.
    Other ideas are welcome!

    Maurice.

  3. #3
    Sencha User
    Join Date
    Apr 2007
    Posts
    172
    Vote Rating
    1
    medusadelft is on a distinguished road

      0  

    Default


    Think I finally nailed it. Not the best solution, but it seems to work. I'm using arrTmp = Ext.DomQuery.select('input[name=txtOldPassword]') which returns an array. And then alter arrTmp.type='text'.
    Warning: this for Ext 4 (!), but probably something similair exists for Ext 3.

  4. #4
    Sencha User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,338
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      0  

    Default


    I don't think there's any need to resort to selectors or direct interaction with DOM nodes:

    Code:
    var passwordField = new Ext.form.TextField({
        inputType: 'password',
        renderTo: Ext.getBody()
    });
    
    new Ext.Button({
        enableToggle: true,
        renderTo: Ext.getBody(),
        text: 'Show Password',
        toggleHandler: function(button, state) {
            passwordField.getEl().set({type: state ? 'text' : 'password'});
        }
    });
    For ExtJS 4 you'll need to update the namespaces and use the inputEl property instead of getEl().

  5. #5
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    France
    Posts
    19
    Vote Rating
    0
    afro is on a distinguished road

      0  

    Question


    I know it's an old post but I want to do the same and I have a problem. It works fine on Safari/Chrome/Firefox, but not on IE (Windows8)
    Any idea about how to make it work?

Similar Threads

  1. show a button on right click on the leaf in the tree panel
    By shivakumar in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 11 Jul 2010, 8:49 AM
  2. How do I show all component's tooltip using a single button click?
    By soulgen in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 1 Jul 2010, 12:00 AM
  3. ContentPanel do not show on click of button
    By navi75 in forum Ext GWT: Discussion
    Replies: 6
    Last Post: 14 Aug 2009, 6:03 PM
  4. show gridpanel using button click
    By lalit_ce in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 6 Oct 2008, 11:52 PM
  5. Show and hide Gridpanel on click of Fileupload Save button
    By email2sathya in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 10 Sep 2008, 10:48 AM

Thread Participants: 3

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar