Results 1 to 4 of 4

Thread: Checkboxgroup Invalid Background Color

  1. #1
    Sencha User
    Join Date
    May 2009
    Posts
    104

    Default Checkboxgroup Invalid Background Color

    I don't' know if this has been covered, I've done a bit of searching and couldn't find it but I assume it would be a common problem.

    I have a checkboxgroup and when i submit the form and the invalid state comes back for the group, it changes the entire background to white. I know the css that controls this lies in: .x-form-invalid, textarea.x-form-invalid. The problem with overriding that is it will do it for all fields in the form. I have over types that are text boxes that I don't want the BG color to be black like I do on the checkboxgroup. Is there a way to individually set the background color on invalid state for a specific field?

  2. #2
    Sencha User
    Join Date
    May 2009
    Posts
    104

    Default

    Anyone have any suggestions on this? I haven't been able to figure out how to change the BG color on invalid state for specific fields. Thanks in advance and Merry Christmas!

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Location
    USA
    Posts
    111

    Default

    PHP Code:
    yourMethidName:function(){
            
    this.form.getForm().items.each(function(item) {
                var 
    el item.el;
                if (
    el.getValue() != '') {
                    
    el.setStyle({color'blue'});
                } else {
                    
    el.setStyle({color'black'});
                }
            });
        } 
    if you need to appear some action to specific elements, you can check it ID or Name or Xtype

  4. #4
    Sencha User
    Join Date
    May 2009
    Posts
    104

    Default

    Thank you very much for the suggestion aramaki! That got me on the right track....

    In case anyone else wants to know, I solved it by adding an event listener to the fields that needed to have the BG a different color than all the rest.

    Code:
                listeners    : {
                    invalid    : function(field, msg) {
                        field.getEl().setStyle("background-color", "white");
                    }
                }

Similar Threads

  1. [FIXED-952] background:transparent instead of background-color:trans
    By grzegorz.borkowski in forum Ext 3.x: Bugs
    Replies: 7
    Last Post: 1 Jun 2010, 7:46 PM
  2. Replies: 2
    Last Post: 12 Apr 2009, 5:52 PM
  3. Change row's text color (not background-color) in grid
    By khnle in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 5 Feb 2008, 6:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •