-
7 Jun 2012 10:59 AM #1
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
Thanks!Code:.redHeader { background: red; } .greenHeader{ background:green; } .blueHeader{ background:blue; }
-
11 Jun 2012 7:22 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,617
- Vote Rating
- 435
So you need to stop the CSS change when you mouse over the header?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
11 Jun 2012 9:13 AM #3
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!
-
12 Jun 2012 1:22 PM #4
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.


Reply With Quote