Our state of the art Gantt chart


Post by cy-maestro »

When I return html in the column renderer, the PDF output contains only the first 15 name column values. If I render the value without html it works correctly. I'm using react 18.2.0 and gantt 5.4.1

import { BryntumGantt } from "@bryntum/gantt-react";
import { MultiPageVerticalExporter } from "@bryntum/gantt";

import { useRef } from "react";
import "./App.scss";

function App() {
  const ganttRef = useRef();

  const pdfExportFeature = {
    alignRows: true,
    exporterType: "multipagevertical",
    exporters: [MultiPageVerticalExporter],
    exportServer: "http://localhost:8081",
    showErrorToast: true,
    exportMask: "Generating Pages",
    orientation: "landscape",
    repeatHeader: true,
  };

  const ganttConfig = {
    columns: [
      {
        type: "name",
        field: "name",
        width: 250,
        renderer: ({ record, value }) => {
          return <span>{value}</span>;
          // comment out the line above that contains html and uncomment the line below and it works
          // return value;
        },
      },
    ],
    viewPreset: "weekAndDayLetter",
    barMargin: 10,
    pdfExportFeature,
    project: {
      transport: {
        load: {
          url: "data/gantt-data.json",
        },
      },
      autoLoad: true,
    },
    ref: ganttRef,
  };

  return (
    <div>
      <button
        onClick={() => {
          const gantt = ganttRef.current?.instance;
          if (!gantt) return undefined;

      const pdfExport = gantt.features?.pdfExport;
      pdfExport.showExportDialog();
    }}
  >
    export
  </button>
  <BryntumGantt {...ganttConfig} />
</div>
  );
}

// If you plan to use stateful React collections for data binding please check this guide
// https://bryntum.com/products/gantt/docs/guide/Gantt/integration/react/data-binding

export default App;

Post by tasnim »

Hi,

Thank you for your report.
We have similar issue reported here https://github.com/bryntum/support/issues/5619

I'll add a comment to that ticket that you're also facing this issue. Please subscribe to that ticket to never miss any update.

All The Best,
Tasnim


Post by davegould41 »

Im also receiving this issue, using custom resourceRenderer


Post Reply