Skip to content

Commit 1c6c22e

Browse files
committed
fix(sample): updated grid sample
1 parent e09506b commit 1c6c22e

2 files changed

Lines changed: 74 additions & 15 deletions

File tree

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,47 @@
11
/* shared styles are loaded from: */
22
/* https://static.infragistics.com/xplatform/css/samples */
33

4-
#grid {
5-
--ig-size: var(--ig-size-medium);
6-
}
4+
:root {
5+
/* Base Palette Colors */
6+
--selection-primary: #0062a3;
7+
--selection-primary-light: #338bc7;
8+
--selection-primary-dark: #004d82;
9+
--selection-secondary: #f2c43c;
10+
--selection-accent: #e74c3c;
11+
--selection-success: #27ae60;
12+
--selection-text-light: #ffffff;
13+
--selection-text-dark: #2c3e50;
14+
--selection-border: #34495e;
15+
--selection-hover: rgba(0, 98, 163, 0.1);
16+
--selection-focus: rgba(242, 196, 60, 0.3);
17+
}
718

8-
#grid {
9-
--cell-selected-text-color: #FFFFFF;
10-
--cell-active-border-color: #f2c43c;
11-
--cell-selected-background: #0062a3;
12-
}
19+
.custom-selection-palette {
20+
/* Core cell selection properties */
21+
--ig-grid-cell-selected-background: var(--selection-primary);
22+
--ig-grid-cell-selected-text-color: var(--selection-text-light);
23+
--ig-grid-cell-active-border-color: var(--selection-secondary);
24+
25+
/* Enhanced selection states */
26+
--ig-grid-cell-selected-range-background: var(--selection-primary-light);
27+
--ig-grid-cell-selected-range-border-color: var(--selection-primary-dark);
28+
--ig-grid-cell-hover-background: var(--selection-hover);
29+
--ig-grid-cell-focus-background: var(--selection-focus);
30+
31+
/* Header selection styling */
32+
--ig-grid-header-selected-background: var(--selection-primary);
33+
--ig-grid-header-selected-text-color: var(--selection-text-light);
34+
35+
/* Row selection integration */
36+
--ig-grid-row-selected-background: var(--selection-primary-light);
37+
--ig-grid-row-selected-text-color: var(--selection-text-dark);
38+
--ig-grid-row-selected-hover-background: var(--selection-primary);
39+
40+
/* Selection indicators and borders */
41+
--ig-grid-selection-fill-color: var(--selection-secondary);
42+
--ig-grid-selection-border-color: var(--selection-border);
43+
44+
/* Grid sizing */
45+
--ig-size: var(--ig-size-medium);
46+
}
1347

samples/grids/grid/cell-selection-custom-palette/src/index.tsx

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,47 @@ export default class Sample extends React.Component<any, any> {
3434
<IgrGrid
3535
ref={this.gridRef}
3636
id="grid"
37+
className="custom-selection-palette"
3738
data={this.customersData}
38-
cellSelection="multiple">
39+
cellSelection="multiple"
40+
rowSelection="multiple"
41+
columnSelection="multiple"
42+
primaryKey="ID"
43+
allowFiltering={true}>
3944
<IgrColumn
40-
field="ID">
45+
field="ID"
46+
header="Customer ID"
47+
width="120px"
48+
sortable={true}>
4149
</IgrColumn>
4250
<IgrColumn
4351
field="Company"
44-
header="Company">
52+
header="Company Name"
53+
width="200px"
54+
sortable={true}>
4555
</IgrColumn>
4656
<IgrColumn
47-
field="Address"
48-
header="Address">
57+
field="ContactName"
58+
header="Contact"
59+
width="150px"
60+
sortable={true}>
4961
</IgrColumn>
5062
<IgrColumn
51-
field="PostalCode"
52-
header="Postal Code">
63+
field="City"
64+
header="City"
65+
width="120px"
66+
sortable={true}>
67+
</IgrColumn>
68+
<IgrColumn
69+
field="Country"
70+
header="Country"
71+
width="120px"
72+
sortable={true}>
73+
</IgrColumn>
74+
<IgrColumn
75+
field="Phone"
76+
header="Phone"
77+
width="150px">
5378
</IgrColumn>
5479
</IgrGrid>
5580
</div>

0 commit comments

Comments
 (0)