Welcome to the Vue feedback portal. We’re happy you’re here! If you have feedback on how to improve the Vue, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

0
Votes

Event dataStateChange cannot be triggered when edit task with dialog or drag task bar.

Here is my code:

<ejs-gantt
            v-if="hasPrivilege"
            ref="gantt"
            id="gantt"
            dateFormat="dd/MM/yyyy hh:mm a"
            includeWeekend="true"
            :allowRowDragAndDrop="true"
            :renderBaseline="renderBaseline"
            :editSettings="editSettings"
            :taskFields="taskFields"
            :toolbar="toolbar"
            :height="height"
            :labelSettings="labelSettings"
            :splitterSettings="splitterSettings"
            :eventMarkers="eventMarkers"
            :enableContextMenu="true"
            :enableCriticalPath="false"
            :highlightWeekends="true"
            :toolbarClick="toolbarClick"
            :contextMenuItems="contextMenuItems"
            :contextMenuClick="contextMenuClick"
            :queryTaskbarInfo="queryTaskbarInfo"
            :queryCellInfo="queryCellInfo"
            :dataBound="dataBound"
            :dataStateChange="dataStateChange"
            :tooltipSettings="tooltipSettings"
            :columns="columns"
            :cellSelected="cellSelected"
            :rowSelected="rowSelected"
            :recordDoubleClick="recordDoubleClick"
            :contextMenuOpen="contextMenuOpen"
          >

components: {
    "ejs-gantt": GanttComponent,
    WorkcardDetail,
  },
  provide: {
    gantt: [
      DayMarkers,
      Resize,
      Filter,
      ContextMenu,
      DayMarkers,
      Toolbar,
      Edit,
      Selection,
      RowDD,
    ],
  },
  setup() {
    const pageHook = usePageHook(pageConfig);
    const viewPageHook = useViewPageHook(pageHook);
    const toolPage = pageHook.toolPage;
    if (
      !toolPage.hasPrivilege({
        privilege: "planning:ganttChart:edit",
      })
    ) {
      //没有编辑权限,跳转到查看
      toolPage.router.push({ path: "/planning/viewer" });
    }

    const gantt = ref(null);
    var criticalTasks: any[] = [];

    let currentWorkPackageNo: string = "";
    const state = reactive({
      ...toRefs(pageHook.state),
      ...toRefs(viewPageHook.state),
      taskFields: {
        id: "taskID",
        name: "taskName",
        milestone: "milestone",
        startDate: "startDate",
        endDate: "endDate",
        duration: "duration",
        progress: "progress",
        dependency: "dependency",
        notes: "notes",
        child: "subtasks",
        expandState: "expandState",
        cssClass: "cssClass",
        baselineStartDate: "baselineStartDate",
        baselineEndDate: "baselineEndDate",
      },
      editSettings: {
        allowAdding: true,
        allowEditing: true,
        allowDeleting: true,
        allowTaskbarEditing: true,
        showDeleteConfirmDialog: true,
        mode: "Dialog",
      },
      contextMenuItems: [
        "TaskInformation",
        "Add",
        { text: "Import WorkCard", target: ".e-content", id: "importWorkCard" },
        { separator: true },
        "DeleteTask",
        "DeleteDependency",
        "Convert",
        {
          text: "Critical Path",
          target: ".e-content",
          id: "criticalPath",
          items: [
            {
              text: "Set Critical Path",
              target: ".e-content",
              id: "setCritical",
            },
            {
              text: "Unset Critical Path",
              target: ".e-content",
              id: "unsetCritical",
            },
          ],
        },
        { separator: true },
        { text: "Collapse Row", target: ".e-content", id: "collapserow" },
        { text: "Expand Row", target: ".e-content", id: "expandrow" },
      ],
      toolbar: [
        { text: "Status: ", id: "toolbarStatus", align: "Right" },
        { type: "Separator", align: "Right" },
        {
          text: "Import Template",
          tooltipText: "Load Template",
          id: "toolbarLoadTemplate",
          align: "Right",
          prefixIcon: "e-folder-open",
        },
        {
          text: "Save",
          tooltipText: "Save to Server",
          id: "toolbarSave",
          align: "Right",
          prefixIcon: "e-save",
        },
        {
          text: "Save & Publish",
          tooltipText: "Save to Server and publish it to customer",
          id: "toolbarPublish",
          align: "Right",
          prefixIcon: "e-bring-to-front",
        },
        "Add",
        "Edit",
        {
          text: "Set BaseLine",
          tooltipText: "Set BaseLine",
          id: "toolbarBaseLine",
          prefixIcon: "e-stamp",
        },
        { type: "Separator" },
        "ExpandAll",
        "CollapseAll",
        "ZoomIn",
        "ZoomOut",
        "ZoomToFit",
        {
          id: "toolbarToday",
          text: "Today",
          prefixIcon: "e-timeline-today",
          tooltipText: "Scroll to Today",
        },
      ],
      height: "768px",
      labelSettings: {
        // leftLabel: "Task Name"
      },
      columns: [
        {
          field: "taskName",
          width: "250",
          //template: "${taskName}",
        },
        { field: "taskID", width: "0" }, // BUG: 去掉后修改不了task
      ],
      splitterSettings: {
        columnIndex: 1,
      },
      tooltipSettings: {
        taskbar: "taskbarTooltipTemplate",
      },
      eventMarkers: [{ day: new Date(), label: "Today" }],
      collapseAllParentTasks: "true",
      renderBaseline: "true",
      publishStatus: "",
    });

const state_methods = {
dataStateChange: function () {
        console.log("dataStateChange");
        state.publishStatus = "0";
      },
}