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

      0  

    Default Trouble with grid header backgrounds in IE8

    Trouble with grid header backgrounds in IE8


    I have been trying to use extjs to make it so that when a user selects a color from a header's dropdown list, the header background changes color. Currently, the code works in Chrome so long as the user is not hovering over the changed header. On IE8, however, the background color only flashes briefly when a hover selector is declared in the css, and even then only after the user hovers over the header for an extended period of time and then stops hovering

    I am trying to fix both problems, but IE8 is the priority. I have tried declaring all selectors, but Chrome continues to change back to the default backgroun on hover and IE8 still behaves incorrectly. If anyone could tell me what I'm doing wrong or suggest an alternate approach, I'd really appreciate it.

    Javascript -
    note that this is declared as the only listener as a GridPanel argument.
    Code:
                    beforerender: function(){                   
                         var menu = this.headerCt.getMenu();
                        menu.add([{
                            text: 'Red',
                            handler: function(){
                                menu.activeHeader.addCls('redHeader');
                            }
                        },
                        
                        {
                            text: 'Blue',
                            handler: function() {
                                menu.activeHeader.addCls('blueHeader');
                            }
                        },
                        {
                            text: 'Green',
                            handler: function(){
                                menu.activeHeader.addCls('greenHeader');
                            }
                        }])                    
                    }            
                }

    CSS
    Code:
    .redHeader {    
            background: red;
        }
    
    
    .greenHeader{
        background:green;
        }
    .blueHeader{
        background:blue;
    }
    Thanks!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,642
    Vote Rating
    899
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    So you need to stop the CSS change when you mouse over the header?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

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

      0  

    Default


    Sorry, I should have been clearer

    Expected/Desired Behavior

    User selects a color from the drop down. The header changes to the selected color (regardless of whether or not the button is hovered over, clicked, etc.). The header stays the selected color unless the user selects a new color.

    Current Chrome Behavior
    User selects the color. The header changes to the selected color. The header turns back to the default styling when moused over (last sentence is the issue).

    Current IE 8 Behavior
    User selects a color. The header does NOT change to the selected color. User mouses over the header and mouses off. The header briefly flashes the chosen color.

    My main concern is getting this working in IE8.

    Thanks!

  4. #4
    Sencha User
    Join Date
    Jun 2012
    Posts
    3
    Vote Rating
    0
    mgale is on a distinguished road

      0  

    Default


    A bit of an update, the problem doesn't seem to effect all CSS attributes for IE8. If I change text color on menu item click instead of background color then everything works as intended.

Thread Participants: 1

Tags for this Thread