Author: konstantin.mishin
Date: 2007-06-12 12:11:35 -0400 (Tue, 12 Jun 2007)
New Revision: 1143
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js
trunk/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
Log:
Added CSS for selection.
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2007-06-12
15:42:00 UTC (rev 1142)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2007-06-12
16:11:35 UTC (rev 1143)
@@ -152,6 +152,8 @@
ScriptOptions scriptOptions = new ScriptOptions(component);
scriptOptions.addOption("selectionInput", getSelectionInputName(
context, (UIScrollableGrid) component));
+ scriptOptions.addOption("selectedClass",
component.getAttributes().get("selectedClass"));
+ scriptOptions.addOption("activeClass",
component.getAttributes().get("activeClass"));
return scriptOptions;
}
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js 2007-06-12
15:42:00 UTC (rev 1142)
+++
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js 2007-06-12
16:11:35 UTC (rev 1143)
@@ -194,6 +194,8 @@
this.selection = new ClientUI.controls.grid.Selection();
this.inputElement = grid.options.selectionInput;
+ this.selectedClass = grid.options.selectedClass;
+ this.activeClass = grid.options.activeClass;
this.restoreState();
this.setListeners();
@@ -233,8 +235,12 @@
while(j <= this.selection.ranges[i].indexes[1]) {
var fElement = $(this.prefix + ":f:" + j);
var nElement = $(this.prefix + ":n:" + j);
- fElement.style.backgroundColor = "#DDDDFF";
- nElement.style.backgroundColor = "#DDDDFF";
+ Element.addClassName(fElement, "idg_row_selected_h");
+ Element.addClassName(nElement, "idg_row_selected_h");
+ Element.addClassName(fElement, "idg_row_selected");
+ Element.addClassName(nElement, "idg_row_selected");
+ Element.addClassName(fElement, this.selectedClass);
+ Element.addClassName(nElement, this.selectedClass);
j++;
}
i++;
@@ -428,16 +434,24 @@
this.selection.addId(rowIndex);
var fElement = $(this.prefix + ":f:" + rowIndex);
var nElement = $(this.prefix + ":n:" + rowIndex);
- fElement.style.backgroundColor = "#DDDDFF";
- nElement.style.backgroundColor = "#DDDDFF";
+ Element.addClassName(fElement, "idg_row_selected_h");
+ Element.addClassName(nElement, "idg_row_selected_h");
+ Element.addClassName(fElement, "idg_row_selected");
+ Element.addClassName(nElement, "idg_row_selected");
+ Element.addClassName(fElement, this.selectedClass);
+ Element.addClassName(nElement, this.selectedClass);
},
removeRowFromSelection: function(rowIndex) {
this.selection.removeId(rowIndex);
var fElement = $(this.prefix + ":f:" + rowIndex);
var nElement = $(this.prefix + ":n:" + rowIndex);
- fElement.style.backgroundColor = "#FFFFFF";
- nElement.style.backgroundColor = "#FFFFFF";
+ Element.removeClassName(fElement, "idg_row_selected_h");
+ Element.removeClassName(nElement, "idg_row_selected_h");
+ Element.removeClassName(fElement, "idg_row_selected");
+ Element.removeClassName(nElement, "idg_row_selected");
+ Element.removeClassName(fElement, this.selectedClass);
+ Element.removeClassName(nElement, this.selectedClass);
},
setActiveRow: function(rowIndex) {
@@ -445,13 +459,21 @@
if(this.activeRow != null) {
fElement = $(this.prefix + ":f:" + this.activeRow);
nElement = $(this.prefix + ":n:" + this.activeRow);
- fElement.style.color = "#000000";
- nElement.style.color = "#000000";
+ Element.removeClassName(fElement, "idg_row_active_h");
+ Element.removeClassName(nElement, "idg_row_active_h");
+ Element.removeClassName(fElement, "idg_row_active");
+ Element.removeClassName(nElement, "idg_row_active");
+ Element.removeClassName(fElement, this.activeClass);
+ Element.removeClassName(nElement, this.activeClass);
}
fElement = $(this.prefix + ":f:" + rowIndex);
nElement = $(this.prefix + ":n:" + rowIndex);
- fElement.style.color = "#0000AA";
- nElement.style.color = "#0000AA";
+ Element.addClassName(fElement, "idg_row_active_h");
+ Element.addClassName(nElement, "idg_row_active_h");
+ Element.addClassName(fElement, "idg_row_active");
+ Element.addClassName(nElement, "idg_row_active");
+ Element.addClassName(fElement, this.activeClass);
+ Element.addClassName(nElement, this.activeClass);
this.activeRow = rowIndex;
}
});
Modified:
trunk/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-06-12
15:42:00 UTC (rev 1142)
+++
trunk/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-06-12
16:11:35 UTC (rev 1143)
@@ -286,6 +286,15 @@
box-sizing: border-box;
-moz-box-sizing: border-box;
}
+
+.idg_row_selected_h {
+ background-color: #DDDDFF;
+}
+
+.idg_row_active_h {
+ color : #0000AA;
+}
+
.ClientUI_Grid_BROdd {
background-color: #FFFFFF;
font: normal 8pt arial;