Skip to content

Commit f42bb3c

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Minor tweaks to suggestion.
1 parent 7562cc5 commit f42bb3c

File tree

3 files changed

+178
-4
lines changed

3 files changed

+178
-4
lines changed

projects/igniteui-angular/src/lib/grids/grid/grid-row.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
[cellSelectionMode]="grid.cellSelection"
195195
[displayPinnedChip]="shouldDisplayPinnedChip(col.visibleIndex)"
196196
[style.height.px]="data.cellMergeMeta.get(col.field).rowSpan * (this.grid.rowHeight + 1)"
197-
[style.zIndex]="100"
197+
[style.zIndex]="data.cellMergeMeta.get(col.field).rowSpan"
198198
[style.min-width]="col.resolvedWidth"
199199
[style.max-width]="col.resolvedWidth"
200200
[style.flex-basis]="col.resolvedWidth"

projects/igniteui-angular/src/lib/grids/grid/grid.pipes.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,15 @@ export class IgxGridCellMergePipe implements PipeTransform {
9999
//TODO condition can be a strategy or some callback that the user can set.
100100
//TODO can also be limited to only sorted columns
101101
if ( prev && prev.recordRef[col.field] === rec[col.field]) {
102-
const root = prev.cellMergeMeta.get(col.field)?.root ?? prev;
103-
root.cellMergeMeta.get(col.field).rowSpan += 1;
104-
recData.cellMergeMeta.get(col.field).root = root;
102+
// const root = prev.cellMergeMeta.get(col.field)?.root ?? prev;
103+
// root.cellMergeMeta.get(col.field).rowSpan += 1;
104+
// recData.cellMergeMeta.get(col.field).root = root;
105+
recData.cellMergeMeta.get(col.field).prev = prev;
106+
let curr = prev;
107+
while(curr) {
108+
curr.cellMergeMeta.get(col.field).rowSpan += 1;
109+
curr = curr.cellMergeMeta.get(col.field).prev;
110+
}
105111
}
106112
}
107113
prev = recData;
@@ -114,6 +120,7 @@ export class IgxGridCellMergePipe implements PipeTransform {
114120
export interface IMergeByResult {
115121
rowSpan: number;
116122
root?: any;
123+
prev?: any;
117124
}
118125

119126
/**

src/app/grid-cellMerging/grid-cellMerging.component.ts

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,173 @@ export class GridCellMergingComponent {
171171
OrderDate: new Date('2006-03-17').toISOString(),
172172
OrderDate2: new Date(1991, 2, 12, 15, 40, 50).toISOString()
173173
},
174+
{
175+
ProductID: 12,
176+
ProductName: 'Chai',
177+
SupplierID: 1,
178+
CategoryID: 2,
179+
QuantityPerUnit: '12 - 550 ml bottles',
180+
UnitPrice: '10.0000',
181+
UnitsInStock: 12,
182+
UnitsOnOrder: 70,
183+
ReorderLevel: 30,
184+
Discontinued: false,
185+
OrderDate: new Date('2006-03-17').toISOString(),
186+
OrderDate2: new Date(1991, 2, 12, 15, 40, 50).toISOString()
187+
},
188+
{
189+
ProductID: 1,
190+
ProductName: 'Chai',
191+
SupplierID: 1,
192+
CategoryID: 1,
193+
QuantityPerUnit: '10 boxes x 20 bags',
194+
UnitPrice: '18.0000',
195+
UnitsInStock: 39,
196+
UnitsOnOrder: 0,
197+
ReorderLevel: 10.567,
198+
Discontinued: false,
199+
OrderDate: null,
200+
OrderDate2: new Date(1991, 2, 12, 18, 40, 50).toISOString()
201+
}, {
202+
ProductID: 2,
203+
ProductName: 'Chai',
204+
SupplierID: 1,
205+
CategoryID: 1,
206+
QuantityPerUnit: '24 - 12 oz bottles',
207+
UnitPrice: '19.0000',
208+
UnitsInStock: 17,
209+
UnitsOnOrder: 40,
210+
ReorderLevel: 25,
211+
Discontinued: false,
212+
OrderDate: new Date('2003-03-17').toISOString(),
213+
OrderDate2: new Date('2003-03-17').toISOString()
214+
},
215+
{
216+
ProductID: 3,
217+
ProductName: 'Chai',
218+
SupplierID: 1,
219+
CategoryID: 1,
220+
QuantityPerUnit: '24 - 12 oz bottles',
221+
UnitPrice: '19.0000',
222+
UnitsInStock: 17,
223+
UnitsOnOrder: 40,
224+
ReorderLevel: 25,
225+
Discontinued: false,
226+
OrderDate: new Date('2003-03-17').toISOString(),
227+
OrderDate2: new Date('2003-03-17').toISOString()
228+
},
229+
{
230+
ProductID: 4,
231+
ProductName: 'Chai',
232+
SupplierID: 1,
233+
CategoryID: 1,
234+
QuantityPerUnit: '24 - 12 oz bottles',
235+
UnitPrice: '20.0000',
236+
UnitsInStock: 20,
237+
UnitsOnOrder: 40,
238+
ReorderLevel: 25,
239+
Discontinued: false,
240+
OrderDate: new Date('2003-03-17').toISOString(),
241+
OrderDate2: new Date('2003-03-17').toISOString()
242+
},
243+
{
244+
ProductID: 5,
245+
ProductName: 'Chai',
246+
SupplierID: 1,
247+
CategoryID: 1,
248+
QuantityPerUnit: '24 - 12 oz bottles',
249+
UnitPrice: '19.0000',
250+
UnitsInStock: 17,
251+
UnitsOnOrder: 40,
252+
ReorderLevel: 25,
253+
Discontinued: false,
254+
OrderDate: new Date('2003-03-17').toISOString(),
255+
OrderDate2: new Date('2003-03-17').toISOString()
256+
},
257+
{
258+
ProductID: 6,
259+
ProductName: 'Chang',
260+
SupplierID: 1,
261+
CategoryID: 1,
262+
QuantityPerUnit: '24 - 12 oz bottles',
263+
UnitPrice: '19.0000',
264+
UnitsInStock: 17,
265+
UnitsOnOrder: 40,
266+
ReorderLevel: 25,
267+
Discontinued: false,
268+
OrderDate: new Date('2003-03-17').toISOString(),
269+
OrderDate2: new Date('2003-03-17').toISOString()
270+
},
271+
{
272+
ProductID: 7,
273+
ProductName: 'Chang',
274+
SupplierID: 1,
275+
CategoryID: 1,
276+
QuantityPerUnit: '24 - 12 oz bottles',
277+
UnitPrice: '19.0000',
278+
UnitsInStock: 17,
279+
UnitsOnOrder: 40,
280+
ReorderLevel: 25,
281+
Discontinued: false,
282+
OrderDate: new Date('2003-03-17').toISOString(),
283+
OrderDate2: new Date('2003-03-17').toISOString()
284+
},
285+
{
286+
ProductID: 8,
287+
ProductName: 'Chang',
288+
SupplierID: 1,
289+
CategoryID: 1,
290+
QuantityPerUnit: '24 - 12 oz bottles',
291+
UnitPrice: '19.0000',
292+
UnitsInStock: 17,
293+
UnitsOnOrder: 40,
294+
ReorderLevel: 30,
295+
Discontinued: false,
296+
OrderDate: new Date('2003-03-17').toISOString(),
297+
OrderDate2: new Date('2003-03-17').toISOString()
298+
},
299+
{
300+
ProductID: 9,
301+
ProductName: 'Aniseed Syrup',
302+
SupplierID: 1,
303+
CategoryID: 2,
304+
QuantityPerUnit: '12 - 550 ml bottles',
305+
UnitPrice: '10.0000',
306+
UnitsInStock: 13,
307+
UnitsOnOrder: 70,
308+
ReorderLevel: 25,
309+
Discontinued: false,
310+
OrderDate: new Date('2006-03-17').toISOString(),
311+
OrderDate2: new Date(1991, 2, 12, 15, 40, 50).toISOString()
312+
},
313+
{
314+
ProductID: 10,
315+
ProductName: 'Chang',
316+
SupplierID: 1,
317+
CategoryID: 2,
318+
QuantityPerUnit: '12 - 550 ml bottles',
319+
UnitPrice: '10.0000',
320+
UnitsInStock: 13,
321+
UnitsOnOrder: 70,
322+
ReorderLevel: 25,
323+
Discontinued: false,
324+
OrderDate: new Date('2006-03-17').toISOString(),
325+
OrderDate2: new Date(1991, 2, 12, 15, 40, 50).toISOString()
326+
},
327+
{
328+
ProductID: 11,
329+
ProductName: 'Chai',
330+
SupplierID: 1,
331+
CategoryID: 2,
332+
QuantityPerUnit: '12 - 550 ml bottles',
333+
UnitPrice: '10.0000',
334+
UnitsInStock: 13,
335+
UnitsOnOrder: 70,
336+
ReorderLevel: 25,
337+
Discontinued: false,
338+
OrderDate: new Date('2006-03-17').toISOString(),
339+
OrderDate2: new Date(1991, 2, 12, 15, 40, 50).toISOString()
340+
},
174341
{
175342
ProductID: 12,
176343
ProductName: 'Chai',

0 commit comments

Comments
 (0)