diff --git a/data-grid/react-samples/react-poc-sample/index.html b/data-grid/react-samples/react-poc-sample/index.html index bdf3c1b..dc2a95b 100644 --- a/data-grid/react-samples/react-poc-sample/index.html +++ b/data-grid/react-samples/react-poc-sample/index.html @@ -4,6 +4,7 @@ + react-grid diff --git a/data-grid/react-samples/react-poc-sample/package.json b/data-grid/react-samples/react-poc-sample/package.json index 5f9a4c7..d28698a 100644 --- a/data-grid/react-samples/react-poc-sample/package.json +++ b/data-grid/react-samples/react-poc-sample/package.json @@ -20,7 +20,8 @@ "@syncfusion/ej2-tailwind3-theme": "~34.2.2", "react": "^19.2.8", "react-dom": "^19.2.8", - "react-router": "8.3.0" + "react-router": "8.3.0", + "xlsx": "^0.18.5" }, "devDependencies": { "@types/react": "^19.2.18", diff --git a/data-grid/react-samples/react-poc-sample/src/Home.css b/data-grid/react-samples/react-poc-sample/src/Home.css index fc2b3a2..dfec1da 100644 --- a/data-grid/react-samples/react-poc-sample/src/Home.css +++ b/data-grid/react-samples/react-poc-sample/src/Home.css @@ -10,6 +10,8 @@ body, body { font-family: 'Hanken Grotesk', sans-serif; + color: #243447; + background: #f3f6fa; } .home-page, @@ -26,11 +28,29 @@ body { .home-grid-parent { width: min(1500px, calc(100% - 48px)); - height: 500px; + min-height: 400px; margin: 24px auto; + padding: 16px; + border: 1px solid #dbe3ec; + border-radius: 8px; + background: #ffffff; + box-shadow: 0 8px 24px #1f293714; overflow: visible; } +.total-record-count { + margin-bottom: 6px; + padding: 5px 12px; + border: 1px solid #d9e2ec; + border-radius: 4px; + background: #f8fafc; + color: #344054; + font-size: 13px; + font-weight: 600; + line-height: 16px; + text-align: left; +} + .top-actions { display: flex; align-items: center; diff --git a/data-grid/react-samples/react-poc-sample/src/components/Adaptive.jsx b/data-grid/react-samples/react-poc-sample/src/components/Adaptive.jsx index 6020624..3310b1e 100644 --- a/data-grid/react-samples/react-poc-sample/src/components/Adaptive.jsx +++ b/data-grid/react-samples/react-poc-sample/src/components/Adaptive.jsx @@ -1,7 +1,7 @@ import { createRoot } from 'react-dom/client'; import * as React from 'react'; -import { GridComponent, ColumnsDirective, ColumnDirective, Inject, Filter, Sort, Group, Edit, Resize, Toolbar, Aggregate, Page, ExcelExport, PdfExport, ColumnChooser, ColumnMenu } from '@syncfusion/ej2-react-grids'; +import { GridComponent, ColumnsDirective, ColumnDirective, Inject, Filter, Sort, Group, Edit, Resize, Toolbar, Aggregate, Page, ExcelExport, PdfExport, ColumnChooser, ColumnMenu, InfiniteScroll } from '@syncfusion/ej2-react-grids'; import { AggregateColumnsDirective, AggregateColumnDirective, AggregateDirective, AggregatesDirective } from '@syncfusion/ej2-react-grids'; import { CheckBoxComponent } from '@syncfusion/ej2-react-buttons'; import { Browser } from "@syncfusion/ej2-base"; @@ -11,83 +11,7 @@ import { PropertyPane } from './property-pane'; // custom code end function Adaptive() { - let hierarchyOrderdata = [ - { - OrderID: 10248, CustomerID: 'VINET', EmployeeID: 5, OrderDate: new Date(8364186e5), - ShipName: 'Vins et alcools Chevalier', ShipCity: 'Reims', ShipAddress: '59 rue de l Abbaye', - ShipRegion: 'CJ', ShipPostalCode: '51100', ShipCountry: 'France', Freight: 32.38, Verified: !0 - }, - { - OrderID: 10249, CustomerID: 'TOMSP', EmployeeID: 6, OrderDate: new Date(836505e6), - ShipName: 'Toms Spezialitäten', ShipCity: 'Münster', ShipAddress: 'Luisenstr. 48', - ShipRegion: 'CJ', ShipPostalCode: '44087', ShipCountry: 'Germany', Freight: 11.61, Verified: !1 - }, - { - OrderID: 10250, CustomerID: 'HANAR', EmployeeID: 2, OrderDate: new Date(8367642e5), - ShipName: 'Hanari Carnes', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua do Paço, 67', - ShipRegion: 'RJ', ShipPostalCode: '05454-876', ShipCountry: 'Brazil', Freight: 65.83, Verified: !0 - }, - { - OrderID: 10251, CustomerID: 'VICTE', EmployeeID: 3, OrderDate: new Date(8367642e5), - ShipName: 'Victuailles en stock', ShipCity: 'Lyon', ShipAddress: '2, rue du Commerce', - ShipRegion: 'CJ', ShipPostalCode: '69004', ShipCountry: 'France', Freight: 41.34, Verified: !0 - }, - { - OrderID: 10252, CustomerID: 'SUPRD', EmployeeID: 4, OrderDate: new Date(8368506e5), - ShipName: 'Suprêmes délices', ShipCity: 'Charleroi', ShipAddress: 'Boulevard Tirou, 255', - ShipRegion: 'CJ', ShipPostalCode: 'B-6000', ShipCountry: 'Belgium', Freight: 51.3, Verified: !0 - }, - { - OrderID: 10253, CustomerID: 'HANAR', EmployeeID: 3, OrderDate: new Date(836937e6), - ShipName: 'Hanari Carnes', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua do Paço, 67', - ShipRegion: 'RJ', ShipPostalCode: '05454-876', ShipCountry: 'Brazil', Freight: 58.17, Verified: !0 - }, - { - OrderID: 10254, CustomerID: 'CHOPS', EmployeeID: 5, OrderDate: new Date(8370234e5), - ShipName: 'Chop-suey Chinese', ShipCity: 'Bern', ShipAddress: 'Hauptstr. 31', - ShipRegion: 'CJ', ShipPostalCode: '3012', ShipCountry: 'Switzerland', Freight: 22.98, Verified: !1 - }, - { - OrderID: 10255, CustomerID: 'RICSU', EmployeeID: 9, OrderDate: new Date(8371098e5), - ShipName: 'Richter Supermarkt', ShipCity: 'Genève', ShipAddress: 'Starenweg 5', - ShipRegion: 'CJ', ShipPostalCode: '1204', ShipCountry: 'Switzerland', Freight: 148.33, Verified: !0 - }, - { - OrderID: 10256, CustomerID: 'WELLI', EmployeeID: 3, OrderDate: new Date(837369e6), - ShipName: 'Wellington Importadora', ShipCity: 'Resende', ShipAddress: 'Rua do Mercado, 12', - ShipRegion: 'SP', ShipPostalCode: '08737-363', ShipCountry: 'Brazil', Freight: 13.97, Verified: !1 - }, - { - OrderID: 10257, CustomerID: 'HILAA', EmployeeID: 4, OrderDate: new Date(8374554e5), - ShipName: 'HILARION-Abastos', ShipCity: 'San Cristóbal', ShipAddress: 'Carrera 22 con Ave. Carlos Soublette #8-35', - ShipRegion: 'Táchira', ShipPostalCode: '5022', ShipCountry: 'Venezuela', Freight: 81.91, Verified: !0 - }, - { - OrderID: 10258, CustomerID: 'ERNSH', EmployeeID: 1, OrderDate: new Date(8375418e5), - ShipName: 'Ernst Handel', ShipCity: 'Graz', ShipAddress: 'Kirchgasse 6', - ShipRegion: 'CJ', ShipPostalCode: '8010', ShipCountry: 'Austria', Freight: 140.51, Verified: !0 - }, - { - OrderID: 10259, CustomerID: 'CENTC', EmployeeID: 7, OrderDate: new Date(8376282e5), - ShipName: 'Centro comercial Moctezuma', ShipCity: 'México D.F.', ShipAddress: 'Sierras de Granada 9993', - ShipRegion: 'CJ', ShipPostalCode: '05022', ShipCountry: 'Mexico', Freight: 3.25, Verified: !1 - }, - { - OrderID: 10260, CustomerID: 'OTTIK', EmployeeID: 4, OrderDate: new Date(8377146e5), - ShipName: 'Ottilies Käseladen', ShipCity: 'Köln', ShipAddress: 'Mehrheimerstr. 369', - ShipRegion: 'CJ', ShipPostalCode: '50739', ShipCountry: 'Germany', Freight: 55.09, Verified: !0 - }, - { - OrderID: 10261, CustomerID: 'QUEDE', EmployeeID: 2, OrderDate: new Date(8377146e5), - ShipName: 'Que Delícia', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua da Panificadora, 12', - ShipRegion: 'RJ', ShipPostalCode: '02389-673', ShipCountry: 'Brazil', Freight: 3.05, Verified: !1 - }, - { - OrderID: 10262, CustomerID: 'RATTC', EmployeeID: 8, OrderDate: new Date(8379738e5), - ShipName: 'Rattlesnake Canyon Grocery', ShipCity: 'Albuquerque', ShipAddress: '2817 Milton Dr.', - ShipRegion: 'NM', ShipPostalCode: '87110', ShipCountry: 'USA', Freight: 48.29, Verified: !0 - } - ]; + // custom code start const SAMPLE_CSS = ` .e-bigger.e-responsive-dialog .e-dlg-content { @@ -220,7 +144,7 @@ function Adaptive() {
{!Browser.isDevice ? (
- { grid = g; }} enableAdaptiveUI={true} rowRenderingMode={renderingMode} allowFiltering={true} allowSorting={true} allowGrouping={false} showColumnChooser={true} showColumnMenu={true} allowPaging={true} groupSettings={groupOptions} filterSettings={filterOptions} toolbar={toolbarOptions} pageSettings={{ pageCount: 3, pageSizes: true }} load={load} toolbarClick={toolbarClick} allowExcelExport={true} allowPdfExport={true}> + { grid = g; }} enableAdaptiveUI={true} rowRenderingMode={renderingMode} allowFiltering={true} allowSorting={true} allowGrouping={false} showColumnChooser={true} showColumnMenu={true} enableInfiniteScrolling={true} groupSettings={groupOptions} filterSettings={filterOptions} toolbar={toolbarOptions} pageSettings={{ pageCount: 3, pageSizes: true }} load={load} toolbarClick={toolbarClick} allowExcelExport={true} allowPdfExport={true}> {/* --------- Stacked header: Order Info --------- */}
-
) : ( { grid = g; }} enableAdaptiveUI={true} rowRenderingMode={renderingMode} allowFiltering={true} allowSorting={true} allowGrouping={false} showColumnChooser={true} showColumnMenu={true} allowPaging={true} groupSettings={groupOptions} filterSettings={filterOptions} pageSettings={{ pageCount: 3, pageSizes: true }} load={load} toolbarClick={toolbarClick} allowExcelExport={true} allowPdfExport={true}> +
) : ( { grid = g; }} enableAdaptiveUI={true} rowRenderingMode={renderingMode} allowFiltering={true} allowSorting={true} allowGrouping={false} showColumnChooser={true} showColumnMenu={true} enableInfiniteScrolling={true} groupSettings={groupOptions} filterSettings={filterOptions} toolbar={toolbarOptions} pageSettings={{ pageCount: 3, pageSizes: true }} load={load} toolbarClick={toolbarClick} allowExcelExport={true} allowPdfExport={true}> + {/* --------- Stacked header: Order Info --------- */} - + )} diff --git a/data-grid/react-samples/react-poc-sample/src/components/Home.jsx b/data-grid/react-samples/react-poc-sample/src/components/Home.jsx index 08daf12..428af3e 100644 --- a/data-grid/react-samples/react-poc-sample/src/components/Home.jsx +++ b/data-grid/react-samples/react-poc-sample/src/components/Home.jsx @@ -25,42 +25,172 @@ import { InfiniteScroll, } from '@syncfusion/ej2-react-grids'; import { DropDownListComponent } from '@syncfusion/ej2-react-dropdowns'; -import { DatePickerComponent } from '@syncfusion/ej2-react-calendars'; -import { NumericTextBoxComponent, TextBoxComponent } from '@syncfusion/ej2-react-inputs'; +import { DropDownList } from '@syncfusion/ej2-dropdowns'; +import { DatePicker } from '@syncfusion/ej2-calendars'; +import { Browser, isNullOrUndefined,extend, setValue, getValue } from "@syncfusion/ej2-base"; +import { SwitchComponent } from '@syncfusion/ej2-react-buttons'; +import { NumericTextBoxComponent, TextBoxComponent, UploaderComponent } from '@syncfusion/ej2-react-inputs'; +import { DialogComponent } from '@syncfusion/ej2-react-popups'; import { Query } from '@syncfusion/ej2-data'; +import * as XLSX from 'xlsx'; import { gridData } from '../data/virtualData'; -function customerNameHeaderTemplate() { - return ( -
-