8080</template >
8181<script setup lang="ts">
8282import { ref } from ' vue' ;
83+ // Our demo infrastructure requires us to use 'file-saver-es'.
84+ // We recommend that you use the official 'file-saver' package in your applications.
85+ import { saveAs } from ' file-saver-es' ;
8386import DxButton from ' devextreme-vue/button' ;
8487import DxTabPanel , { DxItem } from ' devextreme-vue/tab-panel' ;
8588import { DxDataGrid , DxColumn } from ' devextreme-vue/data-grid' ;
86-
8789import { Workbook } from ' devextreme-exceljs-fork' ;
88- // Our demo infrastructure requires us to use 'file-saver-es'.
89- // We recommend that you use the official 'file-saver' package in your applications.
90- import { saveAs } from ' file-saver-es' ;
91- import { type DataGridCell , exportDataGrid } from ' devextreme-vue/common/export/excel' ;
90+ import { type DataGridCell as Ex сelDataGridCell , exportDataGrid } from ' devextreme-vue/common/export/excel' ;
9291import { type DataSourceOptions } from ' devextreme-vue/common/data' ;
9392
94- import ' devextreme-vue/common/data' ;
95-
9693const priceGridRef = ref <DxDataGrid | null >(null );
9794const ratingGridRef = ref <DxDataGrid | null >(null );
9895
@@ -132,15 +129,19 @@ const exportGrids = () => {
132129 worksheet: priceSheet ,
133130 component: priceGridRef .value ?.instance ,
134131 topLeftCell: { row: 4 , column: 2 },
135- customizeCell : ({ gridCell , excelCell }) => {
136- setAlternatingRowsBackground (gridCell , excelCell );
132+ customizeCell : ({ gridCell , excelCell }: { gridCell? : Ex сelDataGridCell , excelCell? : any }) => {
133+ if (gridCell ) {
134+ setAlternatingRowsBackground (gridCell , excelCell );
135+ }
137136 },
138137 }).then (() => exportDataGrid ({
139138 worksheet: ratingSheet ,
140139 component: ratingGridRef .value ?.instance ,
141140 topLeftCell: { row: 4 , column: 2 },
142- customizeCell : ({ gridCell , excelCell }) => {
143- setAlternatingRowsBackground (gridCell , excelCell );
141+ customizeCell : ({ gridCell , excelCell }: { gridCell? : Ex сelDataGridCell , excelCell? : any }) => {
142+ if (gridCell ) {
143+ setAlternatingRowsBackground (gridCell , excelCell );
144+ }
144145 },
145146 })).then (() => {
146147 workbook .xlsx .writeBuffer ().then ((buffer ) => {
@@ -149,7 +150,7 @@ const exportGrids = () => {
149150 });
150151};
151152
152- const setAlternatingRowsBackground = (gridCell : DataGridCell , excelCell : any ) => {
153+ const setAlternatingRowsBackground = (gridCell : Ex с elDataGridCell , excelCell : any ) => {
153154 if (gridCell .rowType === ' header' || gridCell .rowType === ' data' ) {
154155 if (excelCell .fullAddress .row % 2 === 0 ) {
155156 excelCell .fill = {
0 commit comments