1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    1
    Vote Rating
    0
    thehodapp is on a distinguished road

      0  

    Default Changing TextField style dynamically

    Changing TextField style dynamically


    I'm trying to set the background-color and color of a TextField (to mask a password) on a checkbox click event. My best try:

    Code:
    var hidePass = new Ext.form.Checkbox({
                    xtype: 'checkbox',
                    boxLabel: 'Hide Password',
                    name: 'hidePass',
                    handler: function (checkbox, checked) {
                        if (checked) {
                            pass1.fieldStyle = 'background-color: #ddd; background-image: none;';
                        }
                    }
                });
    this code doesn't work. No errors are thrown. I'm not sure where to go from here. I've searched everywhere and can't find anything like this. I can't find any properties or methods to change the style that works.

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,332
    Vote Rating
    83
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi!

    Try this:-

    Code:
    YourTextField.setFieldStyle('background-color: red;');
    OR if above doesn't work....

    Try to add a class, like this:-
    CSS:-

    Code:
    .changeColorRed{
         background:red
    }
    Code:
    YourTextfield.addClass('changeColorRed'); // add red color
    YourTextfield.removeClass('changeColorRed'); // remove red color
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

Thread Participants: 1

Tags for this Thread

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