Our state of the art Gantt chart


Post by vconstruct »

Hi,
We are not able to get the custom added/registered column values in exported excel file.

Here is the column definition

const columnDef: Partial<ColumnStoreConfig>[] | object[] = [
    {type: 'activityidcolumn'},
    {
      type: 'name',
      field: 'name',
      text: 'Activity Name',
      width: 350,
      editor: false,
    },
    { type: 'statuscolumn' },
    { type: 'date', field: 'startDate', text: 'Start Date', editor: false },
    { type: 'date', field: 'endDate', text: 'End Date', editor: false },
    { type: 'duration', field: 'duration', editor: false },
    {
      type: 'percentdone',
      field: 'percentDone',
      text: 'Progress',
      editor: false,
    },
    { field: 'critical', text: 'Is Critical', editor: false, hidden: true },
    {
      type   : 'resourceassignment',
      itemTpl  : (assignment: { resourceName: string; }) => assignment.resourceName,
      editor: false,
    }
  ];

And here is how we have registered the status column -
StatusColumn.js

import { Column, ColumnStore } from '@bryntum/gantt'

export class StatusColumn extends Column {
  static get $name() {
    return 'StatusColumn'
  }

  static get type() {
    return 'statuscolumn'
  }

  static get isGanttColumn() {
    return true
  }

  static get defaults() {
    return {
      field: '_data.status',
      text: 'Status',
      editor: false,
      cellCls: 'b-status-column-cell',
      htmlEncode: false,
      exportedType: 'string',
      filterable: ({value, record}) => {
        value = value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
        if(record._data.status?.match(new RegExp(value, 'i'))){
          return record
        }
      }
    }
  }
}

Here is the excel snapshot

excel column value.png
excel column value.png (51.4 KiB) Viewed 287 times

Here is the Gantt preview

ganttColumnValue.png
ganttColumnValue.png (163.83 KiB) Viewed 287 times

Post by mats »

      field: '_data.status',

This looks wrong, I suspect it should be just 'status'? Does it work then?

Can you please share the Model definition too?


Post by vconstruct »

We are using the same format as in Bryntum. Here's the snapshot of it.

Modeldefinition.png
Modeldefinition.png (24.9 KiB) Viewed 245 times

And also attaching the json data for the reference

jsonformatter.txt
(124.7 KiB) Downloaded 17 times

Post by marcio »

Hey, I believe that the suggestion that Mats did would make it work. Could you please try it and check it?

Change

static get defaults() {
    return {
      field: '_data.status',

to

static get defaults() {
    return {
      field: 'status',

Best regards,
Márcio


Post by vconstruct »

Hi,
We already have tried it. It won't render value in the gantt control as well as in excel file


Post by marcio »

Ok, Could you please assemble a sample project with all your configuration and data processing?? We'll use the data that you provided in this post with your project to help identity what's causing that non-exporting issue.

You can get one of our demos and then adapt to match your case, and then zip it and send it here.

Best regards,
Márcio


Post Reply