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,333
    Vote Rating
    85
    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

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."