1. #1
    Sencha User
    Join Date
    Mar 2008
    Posts
    55
    Vote Rating
    8
    andong is on a distinguished road

      0  

    Default [4.2.1 744] fieldCls not work while field is empty

    [4.2.1 744] fieldCls not work while field is empty


    I added a fieldCls property for a textfield to display a small icon on its left side in a logon page, but the field will repeat the icon in whole field while I clear the textfield's text, when I input a word it works fine and only display one icon on its left side.

    css:
    Code:
    .userName
    {
        background-image: url(image/login-user.png) !important;
        background-repeat: no-repeat;   
        background-position: left;
    }
    I debuged and I have found that ext matched the css named 'input.x-form-invalid-field, textarea.x-form-invalid-field' instead of my customed css 'userName' when the field's text was cleared, I think this is the key issue.
    Last edited by andong; 12 May 2013 at 7:31 PM. Reason: Added version

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,357
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    You'll need to put !important after the background repeat / position rules if you want them to supersede rules from the default ExtJS CSS.

  3. #3
    Sencha - Ext JS Dev Team Phil Guerrant's Avatar
    Join Date
    May 2011
    Location
    Colorado
    Posts
    321
    Vote Rating
    87
    Phil Guerrant is just really nice Phil Guerrant is just really nice Phil Guerrant is just really nice Phil Guerrant is just really nice Phil Guerrant is just really nice

      0  

    Default


    Quote Originally Posted by slemmon View Post
    You'll need to put !important after the background repeat / position rules if you want them to supersede rules from the default ExtJS CSS.
    Or just increase their specificity

    Code:
    .x-field input.userName { ... }
    Phil Guerrant
    Ext JS - Development Team

  4. #4
    Sencha User
    Join Date
    Mar 2008
    Posts
    55
    Vote Rating
    8
    andong is on a distinguished road

      0  

    Default


    Quote Originally Posted by slemmon View Post
    You'll need to put !important after the background repeat / position rules if you want them to supersede rules from the default ExtJS CSS.
    Thanks, It works fine.

Thread Participants: 2

Tags for this Thread