Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit f5ef799

Browse files
authored
feat: add rowspan implementation (#454)
1 parent 651a841 commit f5ef799

File tree

13 files changed

+2274
-336
lines changed

13 files changed

+2274
-336
lines changed

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@
8383
"/src/slickgrid-react"
8484
],
8585
"dependencies": {
86-
"@slickgrid-universal/common": "~5.11.0",
87-
"@slickgrid-universal/custom-footer-component": "~5.11.0",
88-
"@slickgrid-universal/empty-warning-component": "~5.11.0",
89-
"@slickgrid-universal/event-pub-sub": "~5.10.2",
90-
"@slickgrid-universal/pagination-component": "~5.11.0",
91-
"@slickgrid-universal/row-detail-view-plugin": "~5.11.0",
86+
"@slickgrid-universal/common": "~5.12.0",
87+
"@slickgrid-universal/custom-footer-component": "~5.12.0",
88+
"@slickgrid-universal/empty-warning-component": "~5.12.0",
89+
"@slickgrid-universal/event-pub-sub": "~5.12.0",
90+
"@slickgrid-universal/pagination-component": "~5.12.0",
91+
"@slickgrid-universal/row-detail-view-plugin": "~5.12.0",
9292
"dequal": "^2.0.3",
9393
"i18next": "^23.16.8",
9494
"sortablejs": "^1.15.6"
@@ -102,14 +102,14 @@
102102
"@fnando/sparkline": "^0.3.10",
103103
"@formkit/tempo": "^0.1.2",
104104
"@popperjs/core": "^2.11.8",
105-
"@release-it/conventional-changelog": "^9.0.4",
106-
"@slickgrid-universal/composite-editor-component": "~5.11.0",
107-
"@slickgrid-universal/custom-tooltip-plugin": "~5.11.0",
108-
"@slickgrid-universal/excel-export": "~5.11.0",
109-
"@slickgrid-universal/graphql": "~5.11.0",
110-
"@slickgrid-universal/odata": "~5.11.0",
111-
"@slickgrid-universal/rxjs-observable": "~5.11.0",
112-
"@slickgrid-universal/text-export": "~5.11.0",
105+
"@release-it/conventional-changelog": "^10.0.0",
106+
"@slickgrid-universal/composite-editor-component": "~5.12.0",
107+
"@slickgrid-universal/custom-tooltip-plugin": "~5.12.0",
108+
"@slickgrid-universal/excel-export": "~5.12.0",
109+
"@slickgrid-universal/graphql": "~5.12.0",
110+
"@slickgrid-universal/odata": "~5.12.0",
111+
"@slickgrid-universal/rxjs-observable": "~5.12.0",
112+
"@slickgrid-universal/text-export": "~5.12.0",
113113
"@types/fnando__sparkline": "^0.3.7",
114114
"@types/i18next-xhr-backend": "^1.4.2",
115115
"@types/node": "^22.10.7",
@@ -122,7 +122,7 @@
122122
"concurrently": "^9.1.2",
123123
"copyfiles": "^2.4.1",
124124
"custom-event-polyfill": "^1.0.7",
125-
"cypress": "^13.17.0",
125+
"cypress": "^14.0.0",
126126
"cypress-real-events": "^1.13.0",
127127
"dompurify": "^3.2.3",
128128
"eslint": "^9.18.0",
@@ -141,7 +141,7 @@
141141
"react-i18next": "^15.4.0",
142142
"react-router-dom": "^7.1.3",
143143
"regenerator-runtime": "^0.14.1",
144-
"release-it": "^17.11.0",
144+
"release-it": "^18.1.1",
145145
"rimraf": "^5.0.10",
146146
"rxjs": "^7.8.1",
147147
"sass": "^1.83.4",

src/examples/slickgrid/App.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ import Example39 from './Example39';
4343
import Example40 from './Example40';
4444
import Example41 from './Example41';
4545
import Example42 from './Example42';
46+
import Example43 from './Example43';
47+
import Example44 from './Example44';
4648

4749
const routes: Array<{ path: string; route: string; component: any; title: string; }> = [
4850
{ path: 'example1', route: '/example1', component: <Example1 />, title: '1- Basic Grid / 2 Grids' },
@@ -86,6 +88,8 @@ const routes: Array<{ path: string; route: string; component: any; title: string
8688
{ path: 'example40', route: '/example40', component: <Example40 />, title: '40- Infinite Scroll from JSON data' },
8789
{ path: 'example41', route: '/example41', component: <Example41 />, title: '41- Drag & Drop' },
8890
{ path: 'example42', route: '/example42', component: <Example42 />, title: '42- Custom Pagination' },
91+
{ path: 'example43', route: '/example43', component: <Example43 />, title: '43- Colspan/Rowspan (timesheets)' },
92+
{ path: 'example44', route: '/example44', component: <Example44 />, title: '44- Colspan/Rowspan (large data)' },
8993
];
9094

9195
export default function Routes() {

src/examples/slickgrid/Example14.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ export default class Example14 extends React.Component {
7676
},
7777
externalResources: [new ExcelExportService()],
7878
explicitInitialization: true,
79-
colspanCallback: this.renderDifferentColspan,
79+
dataView: {
80+
globalItemMetadataProvider: {
81+
getRowMetadata: (item: any, row: number) => this.renderDifferentColspan(item, row),
82+
},
83+
},
8084
gridMenu: {
8185
iconButtonContainer: 'preheader' // we can display the grid menu icon in either the preheader or in the column header (default)
8286
},
@@ -142,8 +146,8 @@ export default class Example14 extends React.Component {
142146
* Your callback will always have the "item" argument which you can use to decide on the colspan
143147
* Your return must always be in the form of:: return { columns: {}}
144148
*/
145-
renderDifferentColspan(item: any): ItemMetadata {
146-
if (item.id % 2 === 1) {
149+
renderDifferentColspan(item: any, row: number): ItemMetadata {
150+
if (item.id % 2 === 1 || row % 2 === 1) {
147151
return {
148152
columns: {
149153
duration: {

src/examples/slickgrid/Example4.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ export default function Example4() {
3131
const [dataset] = useState(getData(NB_ITEMS));
3232

3333
useEffect(() => {
34-
return () => {
35-
saveCurrentGridState();
36-
}
34+
saveCurrentGridState();
3735
}, []);
3836

3937
const columnDefinitions: Column[] = [

0 commit comments

Comments
 (0)