{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "gantt-default-editing",
  "framework": "javascript",
  "type": "registry:component",
  "component": "Gantt",
  "variant": "default-editing",
  "dependencies": [
    "@syncfusion/ej2-gantt"
  ],
  "description": "Gantt chart sample with editing, dependency changes, and task updates in the timeline.",
  "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/gantt-default-editing.md"
  },
  "files": [
    {
      "target": "src/components/gantt-default-editing/gantt.html",
      "content": "<div class=\"control-section\">\n    <div class=\"content-wrapper\">\n        <div id=\"container\">\n        </div>\n        <div style=\"float: right; margin: 10px;\">Source:\n            <a href=\"https://en.wikipedia.org/wiki/Construction\" target='_blank'>https://en.wikipedia.org/</a>\n        </div>\n    </div>\n</div>\n\n<!-- Open in new window dialog height -->\n<style>\n    .e-gantt-dialog {\n        max-height: 719px !important;\n    }\n</style>\n"
    },
    {
      "target": "src/components/gantt-default-editing/gantt.ts",
      "content": "import { Gantt, Edit, Selection, Toolbar, DayMarkers } from '@syncfusion/ej2-gantt';\nimport { defaultEditingData, editingResources } from '../datasource/gantt-data';\n/**\n * Editing Gantt sample\n */\nGantt.Inject(Edit, Selection, Toolbar, DayMarkers);\n\nexport function initDefaultEditingGantt(): void {\n    let startDate: Date;\n    let gantt: Gantt = new Gantt(\n        {\n            dataSource: defaultEditingData,\n            dateFormat: 'MMM dd, y',\n            taskFields: {\n                id: 'TaskID',\n                name: 'TaskName',\n                startDate: 'StartDate',\n                endDate: 'EndDate',\n                duration: 'Duration',\n                durationUnit: 'DurationUnit',\n                progress: 'Progress',\n                dependency: 'Predecessor',\n                parentID: 'ParentId',\n                notes: 'info',\n                resourceInfo: 'resources'\n            },\n            editSettings: {\n                allowAdding: true,\n                allowEditing: true,\n                allowDeleting: true,\n                allowTaskbarEditing: true,\n                showDeleteConfirmDialog: true\n            },\n            toolbar: ['Add', 'Edit', 'Update', 'Delete', 'Cancel', 'ExpandAll', 'CollapseAll', 'Indent', 'Outdent'],\n            allowSelection: true,\n            gridLines: 'Both',\n            height: '650px',\n            rowHeight: 46,\n            taskbarHeight: 25,\n            treeColumnIndex: 1,\n            resourceFields: {\n                id: 'resourceId',\n                name: 'resourceName'\n            },\n            resources: editingResources,\n            created: function() {\n                if(document.querySelector('.e-bigger'))\n                {\n                  gantt.rowHeight = 48;\n                  gantt.taskbarHeight = 28;\n                }\n            },\n            highlightWeekends: true,\n            timelineSettings: {\n                topTier: {\n                    unit: 'Week',\n                    format: 'MMM dd, y'\n                },\n                bottomTier: {\n                    unit: 'Day'\n                },\n            },\n            enableHover: true,\n            columns: [\n                { field: 'TaskID', width: 80 },\n                { field: 'TaskName', headerText: 'Job Name', width: 260, clipMode: 'EllipsisWithTooltip', validationRules: { required: true, minLength: [5, 'Task name should have a minimum length of 5 characters'] } },\n                { field: 'Duration', validationRules: { required: true} },\n                { field: 'StartDate' },\n                { field: 'EndDate', validationRules: { required: [customFn, 'Please enter a value greater than the start date.'] } },\n                { field: 'Progress', validationRules: { required: true, min: 0, max: 100 } },\n                { field: 'Predecessor' }\n            ],\n            labelSettings: {\n                leftLabel: 'TaskName',\n                rightLabel: 'resources'\n            },\n            editDialogFields: [\n                { type: 'General', headerText: 'General' },\n                { type: 'Dependency' },\n                { type: 'Resources' },\n                { type: 'Notes' }\n            ],\n            splitterSettings: {\n                columnIndex: 3\n            },\n            actionBegin: function (args: any) {\n                if (args.columnName === \"EndDate\" || args.requestType === \"beforeOpenAddDialog\" || args.requestType === \"beforeOpenEditDialog\") {\n                    startDate = args.rowData.ganttProperties.startDate;\n                }\n                if (args.requestType === \"taskbarediting\" && args.taskBarEditAction === \"ChildDrag\") {\n                    startDate = args.data.ganttProperties.startDate;\n                }\n            },\n            projectStartDate: new Date('03/26/2025'),\n            projectEndDate: new Date('09/10/2025')\n        });\n    gantt.appendTo('#container');\n    function customFn(args: any) {\n        let endDate: Date;\n        if (args.element && args.value) {\n            let dateOptions = { format: gantt.dateFormat, type: 'dateTime', skeleton: 'yMd' };\n            endDate =  gantt.globalize.parseDate(args.value, dateOptions);\n            if (!startDate && gantt.editModule.dialogModule['beforeOpenArgs']) {\n                startDate = gantt.editModule.dialogModule['beforeOpenArgs'].rowData['ganttProperties'].startDate;\n                endDate = (gantt.editModule.dialogModule['beforeOpenArgs'].rowData['ganttProperties'].endDate);\n            }\n            startDate.setHours(0, 0, 0, 0);\n            endDate.setHours(0, 0, 0, 0);\n        }\n        return startDate <= endDate;\n    }\n};\n"
    }
  ]
}