Import Project File - Custom Column

Hi!

I’m trying to import a costum column from a project file, but I can’t get my column data.

image

Hello,
I see that “resource” property has an array. I tried adding arrays in the data, but Gantt displays everything correctly:
http://snippet.dhtmlx.com/6a990fc97
Please try reproducing the issue in the snippet above and click on the “Share” button to copy the link.
Or send me part of your data so that I’ll be able to reproduce the issue and see what might be wrong.

Hi, thanks for your answer!

I try to get a custom column data from a project file, but I can’t see it in my callback data (“Texto Que Quiero”) .

I need add custom columns to my gantt using “importFromMSProject” function.

Code

Callback

Project File Data

Hello,
Thank you for the clarification.
You need to specify those custom properties before loading the data:

gantt.importFromMSProject({
	data: file,
	taskProperties: ["Notes", "Name"],
	callback: function (project) {

Then Gantt will load custom data so you will see that when you use console.log(project) command.
Before the tasks are loaded, you need to assign those custom properties and delete custom data if you need that:

gantt.attachEvent("onTaskLoading", function(task) {
    if (task.$custom_data) {
        task.notes = task.$custom_data["Notes"];
      	task.resource_names = task.$custom_data["Name"];
//        delete task.$custom_data;
    }
    return true;
});

You can learn more about it in the following article:
https://docs.dhtmlx.com/gantt/desktop__export_msproject.html#importsettings
Here is the snippet where you can see how it works:
http://snippet.dhtmlx.com/fa98cb53b
and the document for a test:
https://files.dhtmlx.com/30d/bcaa9435d179311c3380144257b2c4e1/custom_column.xml

1 Like