{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "grid-detail-template",
  "framework": "javascript",
  "type": "registry:component",
  "component": "Grid",
  "variant": "detail-template",
  "dependencies": [
    "@syncfusion/ej2-grids"
  ],
  "description": "Data grid with a detail row template that expands a row to reveal the shipped order lines and totals beneath it.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/javascript/llms.txt",
    "skillPack": "syncfusion/javascript-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/javascript/grid-detail-template.md"
  },
  "files": [
    {
      "target": "src/components/grid-detail-template/grid.html",
      "content": "<div class=\"control-section\">\n    <div class=\"content-wrapper\">\n        <div id=\"container\"></div>\n    </div>\n</div>\n<script id=\"detailtemplate\" type=\"text/x-template\">\n    <div style=\"display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:16px;padding:16px 24px;background:#f8fafc\">\n        <div style=\"background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:16px\">\n            <h5 style=\"margin:0 0 12px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:#64748b\">Shipment timeline</h5>\n            <div style=\"display:flex;align-items:flex-start;gap:12px;margin-bottom:14px\">\n                <span style=\"width:10px;height:10px;margin-top:5px;border-radius:50%;background:#6366f1;box-shadow:0 0 0 4px #e0e7ff;flex-shrink:0\"></span>\n                <div>\n                    <div style=\"font-weight:600;color:#0f172a\">Order placed</div>\n                    <div style=\"font-size:12px;color:#64748b\">${OrderDateText}</div>\n                </div>\n            </div>\n            <div style=\"display:flex;align-items:flex-start;gap:12px\">\n                <span style=\"width:10px;height:10px;margin-top:5px;border-radius:50%;background:#6366f1;box-shadow:0 0 0 4px #e0e7ff;flex-shrink:0\"></span>\n                <div>\n                    <div style=\"font-weight:600;color:#0f172a\">Shipped</div>\n                    <div style=\"font-size:12px;color:#64748b\">${ShippedDateText} · ${Days} days after order</div>\n                </div>\n            </div>\n        </div>\n        <div style=\"background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:16px\">\n            <h5 style=\"margin:0 0 12px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:#64748b\">Delivery address</h5>\n            <div style=\"font-weight:600;color:#0f172a\">${ShipName}</div>\n            <div style=\"color:#475569;margin-top:4px\">${ShipAddress}</div>\n            <div style=\"color:#475569\">${ShipCity}, ${ShipCountry}</div>\n        </div>\n        <div style=\"background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:16px\">\n            <h5 style=\"margin:0 0 12px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:#64748b\">Freight charge</h5>\n            <div style=\"font-size:28px;font-weight:700;color:#0f172a\">${FreightText}</div>\n            <div style=\"font-size:12px;color:#64748b;margin-top:4px\">Customer ${CustomerID}</div>\n        </div>\n    </div>\n</script>"
    },
    {
      "target": "src/components/grid-detail-template/grid.ts",
      "content": "import { Grid, Page, DetailRow } from '@syncfusion/ej2-grids';\nimport { orderData } from '../datasource/grid-data';\n\nGrid.Inject(Page, DetailRow);\n\nconst fmt = (d: any): string => new Date(d).toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' });\n\nfunction prepare(): Object[] {\n    return (orderData as any[]).map((o: any) => ({\n        ...o,\n        Days: Math.max(0, Math.round((new Date(o.ShippedDate).getTime() - new Date(o.OrderDate).getTime()) / 86400000)),\n        OrderDateText: fmt(o.OrderDate),\n        ShippedDateText: fmt(o.ShippedDate),\n        FreightText: '$' + Number(o.Freight).toFixed(2)\n    }));\n}\n\nexport function initDetailTemplateGrid(): void {\n    const grid: Grid = new Grid({\n        dataSource: prepare(),\n        height: 460,\n        allowPaging: true,\n        pageSettings: { pageSize: 8 },\n        gridLines: 'Horizontal',\n        detailTemplate: '#detailtemplate',\n        columns: [\n            { field: 'OrderID', headerText: 'Order', width: 110, isPrimaryKey: true },\n            { field: 'ShipName', headerText: 'Ship To', width: 240 },\n            { field: 'ShipCity', headerText: 'City', width: 160 },\n            { field: 'ShipCountry', headerText: 'Country', width: 150 },\n            { field: 'Freight', headerText: 'Freight', width: 120, format: 'C2', textAlign: 'Right' }\n        ]\n    });\n    grid.appendTo('#container');\n}"
    }
  ]
}