I am trying to use two styles to affect the alternate record styles in a ListGrid.
Here is my test code
Here is the CSS
I have attached a screen capture of the resulting display.
As you may be able to see, the text color of the second row is black rather blue as specified by the CSS AlternateBodyStyleName style class.
Here is my test code
Code:
[B]public[/B] [B]class[/B] AlternateRecordStyleTest [B]extends[/B] ListGrid { [B]private[/B] [B]static[/B] [B]final[/B] [B]int[/B] [B][I]NUMBER_OF_RECORDS[/I][/B] = 3; [B]private[/B] [B]static[/B] [B]final[/B] String [B][I]FIELD_NAME[/I][/B] = "Field"; [B]public[/B] AlternateRecordStyleTest() { setAlternateRecordStyles([B]true[/B]); setAlternateBodyStyleName("AlternateBodyStyleName"); setBaseStyle("BaseStyle"); setFields([B]new[/B] ListGridField([B][I]FIELD_NAME[/I][/B])); ListGridRecord[] records = [B]new[/B] ListGridRecord[[B][I]NUMBER_OF_RECORDS[/I][/B]]; [B]for[/B] ([B]int[/B] i = 1; i <= [B][I]NUMBER_OF_RECORDS[/I][/B]; i++) { ListGridRecord record = [B]new[/B] ListGridRecord(); record.setAttribute([B][I]FIELD_NAME[/I][/B], "Record " + i); records[i - 1] = record; } setData(records); } }
Code:
[I].BaseStyle[/I]{ color: [I]red[/I]; } [I].AlternateBodyStyleName[/I] { color: [I]blue[/I]; }
As you may be able to see, the text color of the second row is black rather blue as specified by the CSS AlternateBodyStyleName style class.
Comment