Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No task type support. Down upgrade... #136

Closed
andre-caldas opened this issue Jan 6, 2025 · 3 comments
Closed

No task type support. Down upgrade... #136

andre-caldas opened this issue Jan 6, 2025 · 3 comments

Comments

@andre-caldas
Copy link

I was using an older version of dhtmlx Gantt. When I upgraded, task types stopped working.

I found it a little disappointing. It is like being downgraded.

I do understand that DHX wants to have special features in a "PRO" version (I don't really understand why "pro" means "non-gpl"... my experience tells me that the less free it is, the less "pro" it is as well). But downgrading when I upgrade is like creating a problem to sell a solution.

It is not really hard to make a little hack to have the functionality back. But I'd rather have DHX fellows to change their approach. :-)

@andre-caldas
Copy link
Author

My hack...

gantt.init("gantt_here");
load_promisse = gantt.load(gantt_json_data_url)

fix_task = function(task) {
  if(task.type == "project") {
    var g = document.getElementById("gantt_here")
    var tl = g.querySelectorAll(`.gantt_task_line[task_id="${task.id}"]`)
    for(let t of tl) {
      t.classList.add("gantt_project")
    }
  }
}
async function fix_tasks() {
  await load_promisse;
  gantt.eachTask(fix_task)
}
fix_tasks()

@gearcoded
Copy link

@andre-caldas,
The task type functionality has always been a Pro feature:
https://docs.dhtmlx.com/gantt/desktop__editions_comparison.html#:~:text=Projects%20and%20Milestones%20task%20types

But due to a bug in the 7.0 version, the Project and Milestone task types started working. The bug was fixed in the 9.0 version, so this feature partially works in all versions between the 7.0 and 9.0.

The code you are using only adds the class name to the task bars. As soon as Gantt is repainted, the original HTML elements are removed, and Gantt creates new ones instead. As a result, the class list you added is removed as well:
https://files.dhtmlx.com/30d/a6c3814de6fe1f801dae84d3e8c38b65/vokoscreen-2025-01-08_17-46-04.mp4

If you only want to have the green color for the task bars with the children, you can return the gantt_project class name in the task_class template:
https://docs.dhtmlx.com/gantt/api__gantt_task_class_template.html

Also, if a parent task is loaded without date parameters (start_date, end_date and duration), Gantt enables the $no_start and $no_end properties for the task object. After that, the parent task depends on the dates of its children - the same way as project tasks work in the Pro version.

Of course, additional features related to the project tasks won't work. You will need to manually implement them. For example, instead of using the drag_project config, you need to use the multiselect extension and select several tasks.

Here is an example in the snippet:
https://snippet.dhtmlx.com/5b9qavkn

Also, "pro" doesn't mean "non-gpl". There is a confusion in the license versions.
There are 3 types of versions depending on the enabled functionality:
• Standard
• Pro
• Trial

The Standard version has less features than the Pro version. Some of the features it doesn't have (like the grid column resize) can be easily implemented. Implementing other features require more time.
The Standard version has the GPL license. The Pro versions can also be used in the projects with the GPL license, though you need to remove the unminified source code of DHTMLX Gantt:
https://dhtmlx.com/docs/faq.shtml#:~:text=We%20want%20to%20include%20your%20DHTMLX%20component%20in%20our%20product%20and%20then%20sell%20it%20to%20our%20customer.%20If%20we%20buy%20Individual/Commercial/Enterprise/Ultimate%20license%20of%20your%20product%2C%20can%20we%20do%20it%3F

@andre-caldas
Copy link
Author

@andre-caldas, The task type functionality has always been a Pro feature: https://docs.dhtmlx.com/gantt/desktop__editions_comparison.html#:~:text=Projects%20and%20Milestones%20task%20types

Lot's of features even in no-Pro. :-)
Well, I'd like you to know that although I sound critical, I am quite satisfied with dhtmlx_gantt.

The code you are using only adds the class name to the task bars. As soon as Gantt is repainted, the original HTML elements are removed, and Gantt creates new ones instead. As a result, the class list you added is removed as well: https://files.dhtmlx.com/30d/a6c3814de6fe1f801dae84d3e8c38b65/vokoscreen-2025-01-08_17-46-04.mp4

A very hackish hack made by someone who doesn't know how to work with dhtmlx properly. I was quite surprised when I realized that resizing (ctrl-+) would make everything being rebuilt. Probably it is something that makes sense in big projects with on demand data and stuff. :-)

If you only want to have the green color for the task bars with the children, you can return the gantt_project class name in the task_class template: https://docs.dhtmlx.com/gantt/api__gantt_task_class_template.html

I will do that. Thank you!

Also, if a parent task is loaded without date parameters (start_date, end_date and duration), Gantt enables the $no_start and $no_end properties for the task object. After that, the parent task depends on the dates of its children - the same way as project tasks work in the Pro version.

Nice to know. I hope it helps future visitors of this thread.

Of course, additional features related to the project tasks won't work. You will need to manually implement them. For example, instead of using the drag_project config, you need to use the multiselect extension and select several tasks.

Here is an example in the snippet: https://snippet.dhtmlx.com/5b9qavkn

I only use dhtmlx_gantt for displaying simple Gantt charts. I do not really know about those amazing features. But I do hope this post can help visitors of this post in the future.

Also, "pro" doesn't mean "non-gpl". There is a confusion in the license versions. There are 3 types of versions depending on the enabled functionality: • Standard • Pro • Trial

Very happy to know! Business models that depend on some sort of fear of the gpl makes me a little uncomfortable. I am very glad to know that this is not exactly the case.

By the way, I do have a GPL python project I intend to use dhtmlx_gantt in the "example" section.

The Standard version has less features than the Pro version. Some of the features it doesn't have (like the grid column resize) can be easily implemented. Implementing other features require more time.

I hope DHX reconsiders its policy regarding those easily workable around stuff. After all, all "Standard" users are potential "Pro" customers and you don't really want them working arround stuff. Or worse, making a terrible hack like mine. :-)

But I do not really have any right to discuss this with you. Sorry for that!

The Pro versions can also be used in the projects with the GPL license, though you need to remove the unminified source code of DHTMLX Gantt: https://dhtmlx.com/docs/faq.shtml#:~:text=We%20want%20to%20include%20your%20DHTMLX%20component%20in%20our%20product%20and%20then%20sell%20it%20to%20our%20customer.%20If%20we%20buy%20Individual/Commercial/Enterprise/Ultimate%20license%20of%20your%20product%2C%20can%20we%20do%20it%3F

Very gray area we are stepping into, here... :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants