-
Notifications
You must be signed in to change notification settings - Fork 672
Demo DataGrid ExcelJSExportMultipleGrids remove odata #31567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0aeb054
808506e
47782ab
3dcf95e
8fac0ec
0d64118
4e6ab6e
e1f80f2
c6fb38f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| import { Injectable } from '@angular/core'; | ||
|
|
||
| export interface Product { | ||
| Product_ID: number; | ||
|
|
||
| Product_Name: string; | ||
|
|
||
| Product_Sale_Price: number; | ||
|
|
||
| Product_Retail_Price: number; | ||
|
|
||
| Product_Consumer_Rating: number; | ||
|
|
||
| Product_Category: string; | ||
| } | ||
|
|
||
| const products: Product[] = [ | ||
| { | ||
| Product_ID: 1, | ||
| Product_Name: "HD Video Player", | ||
| Product_Sale_Price: 220.00, | ||
| Product_Retail_Price: 330.00, | ||
| Product_Consumer_Rating: 4, | ||
| Product_Category: "Video Players", | ||
| }, | ||
| { | ||
| Product_ID: 2, | ||
| Product_Name: "SuperHD Video Player", | ||
| Product_Sale_Price: 275.00, | ||
| Product_Retail_Price: 400.00, | ||
| Product_Consumer_Rating: 4, | ||
| Product_Category: "Video Players", | ||
| }, | ||
| { | ||
| Product_ID: 3, | ||
| Product_Name: "SuperPlasma 50", | ||
| Product_Sale_Price: 1800.00, | ||
| Product_Retail_Price: 2400.00, | ||
| Product_Consumer_Rating: 4.5, | ||
| Product_Category: "Televisions", | ||
| }, | ||
| { | ||
| Product_ID: 4, | ||
| Product_Name: "SuperLED 50", | ||
| Product_Sale_Price: 1100.00, | ||
| Product_Retail_Price: 1600.00, | ||
| Product_Consumer_Rating: 5, | ||
| Product_Category: "Televisions", | ||
| }, | ||
| { | ||
| Product_ID: 5, | ||
| Product_Name: "SuperLED 42", | ||
| Product_Sale_Price: 1050.00, | ||
| Product_Retail_Price: 1450.00, | ||
| Product_Consumer_Rating: 5, | ||
| Product_Category: "Televisions", | ||
| }, | ||
| { | ||
| Product_ID: 6, | ||
| Product_Name: "SuperLCD 55", | ||
| Product_Sale_Price: 1045.00, | ||
| Product_Retail_Price: 1350.00, | ||
| Product_Consumer_Rating: 4.5, | ||
| Product_Category: "Televisions", | ||
| }, | ||
| { | ||
| Product_ID: 7, | ||
| Product_Name: "SuperLCD 42", | ||
| Product_Sale_Price: 999.00, | ||
| Product_Retail_Price: 1200.00, | ||
| Product_Consumer_Rating: 4, | ||
| Product_Category: "Televisions", | ||
| }, | ||
| { | ||
| Product_ID: 8, | ||
| Product_Name: "SuperPlasma 65", | ||
| Product_Sale_Price: 2900.00, | ||
| Product_Retail_Price: 3500.00, | ||
| Product_Consumer_Rating: 3, | ||
| Product_Category: "Televisions", | ||
| }, | ||
| { | ||
| Product_ID: 9, | ||
| Product_Name: "SuperLCD 70", | ||
| Product_Sale_Price: 3200.00, | ||
| Product_Retail_Price: 4000.00, | ||
| Product_Consumer_Rating: 4, | ||
| Product_Category: "Televisions", | ||
| }, | ||
| ]; | ||
|
|
||
| @Injectable() | ||
| export class Service { | ||
| getProducts() { | ||
| return products; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,88 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| export interface Product { | ||||||||||||||||||||||||||||||||||||||||||||||
| Product_ID: number; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| Product_Name: string; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| Product_Sale_Price: number; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| Product_Retail_Price: number; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| Product_Consumer_Rating: number; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| Product_Category: string; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+2
to
+12
|
||||||||||||||||||||||||||||||||||||||||||||||
| Product_ID: number; | |
| Product_Name: string; | |
| Product_Sale_Price: number; | |
| Product_Retail_Price: number; | |
| Product_Consumer_Rating: number; | |
| Product_Category: string; | |
| Product_ID!: number; | |
| Product_Name!: string; | |
| Product_Sale_Price!: number; | |
| Product_Retail_Price!: number; | |
| Product_Consumer_Rating!: number; | |
| Product_Category!: string; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,28 +2,25 @@ import React, { useCallback, useRef } from 'react'; | |
| import Button from 'devextreme-react/button'; | ||
| import TabPanel, { Item } from 'devextreme-react/tab-panel'; | ||
| import DataGrid, { Column } from 'devextreme-react/data-grid'; | ||
| import { ArrayStore } from 'devextreme-react/common/data'; | ||
| import { Workbook } from 'devextreme-exceljs-fork'; | ||
| import { saveAs } from 'file-saver-es'; | ||
| import { exportDataGrid } from 'devextreme-react/common/export/excel'; | ||
| import 'devextreme-react/common/data'; | ||
| import { products } from './data.js'; | ||
|
|
||
| const priceDataSource = { | ||
| store: { | ||
| type: 'odata', | ||
| version: 2, | ||
| url: 'https://js.devexpress.com/Demos/DevAV/odata/Products', | ||
| store: new ArrayStore({ | ||
| data: products, | ||
| key: 'Product_ID', | ||
| }, | ||
| }), | ||
| select: ['Product_ID', 'Product_Name', 'Product_Sale_Price', 'Product_Retail_Price'], | ||
| filter: ['Product_ID', '<', 10], | ||
| }; | ||
|
Comment on lines
11
to
18
|
||
| const ratingDataSource = { | ||
| store: { | ||
| type: 'odata', | ||
| version: 2, | ||
| url: 'https://js.devexpress.com/Demos/DevAV/odata/Products', | ||
| store: new ArrayStore({ | ||
| data: products, | ||
| key: 'Product_ID', | ||
| }, | ||
| }), | ||
| select: ['Product_ID', 'Product_Name', 'Product_Consumer_Rating', 'Product_Category'], | ||
| filter: ['Product_ID', '<', 10], | ||
| }; | ||
|
Comment on lines
19
to
26
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
.tsfile extension should be omitted in TypeScript imports. In TypeScript/JavaScript module systems, file extensions are typically not included for local modules as the bundler/compiler resolves them automatically. Change toimport { products } from './data';