Have a look at this documentation: Row Spanning Complex Example
You can use rowSpan
property of ColDef
while providing values for your ColDef
. Provide rowSpan
1
for the two columns (2nd and 3rd visible in the screenshot), conditionally 1
or 2
for the 4th and 2
for the others.
colDef = [
{ field: 'field1', rowSpan: 2, /* other props */ },
{ field: 'field2', rowSpan: 1, /* other props */ },
{ field: 'field3', rowSpan: 1, /* other props */ },
{ field: 'field4', /* other props */,
rowSpan: (params) => {
return // your condition which decides rowSpan
}
},
{ field: 'field5', rowSpan: 2, /* other props */ },
{ field: 'field6', rowSpan: 2, /* other props */ }
];
ag-grid Row spanning also has some limitations. Make sure you check this out as well: Constraints with Row Spanning
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.