dhtmlxGantt v2.1 Beta

in the nearest weeks we plan to release update of the Gantt chart, you may check the beta.

Main changes are

  • Enhanced customization of time scales
  • Working time support
  • Milestone support and custom task types

1)Customizable time scales.
Certain time units can be skipped from the time scale. Practically this means that now you can display days only in working hours (e.g. 9-17 instead of 0-23), or skip weekends from the scale.

Skipped columns can be defined with gantt.ignore_scale function. It is called for each column of the scale (if multiple scales defined - for each column of the lowest scale), column date is passed as a first argument. Returning boolean true will skip column.
By default, the duration of skipped columns is still counted.gantt.ignore_time = function(date){ if(date.getDay() == 0 || date.getDay() == 6) return true; return false; };

Related examples can be found at /samples/03_scales and /samples/09_worktime

2) Ability to set the duration of tasks in work days or work hours, instead of calendar days.
This functionality can be used with time scale configuration from the previous paragraph.

By default checking of a work time is disabled.
Enable: gantt.config.work_time = true;

Predefined settings - work hours - 8-17, work days - Monday-Friday

Can be configured with gantt.setWorkTime function. The method takes settings object with following properties

  • day: Number of day of week(0-6),
  • hours: array of working hours as ‘from’-‘to’ pairs, can define several intervals - [9, 17], or [9,12, 13, 17]; ‘false’ - define not working day, ‘true’(default value) - make working day using global hours
  • date : Date object

}[code]//global working hours
gantt.setWorkTime({hours : [8,17]});
// make Tuesdays day-off
gantt.setWorkTime({day : 2, hours : false});

//Fridays and Saturdays are short days
gantt.setWorkTime({day : 5, hours : [8,12]});
gantt.setWorkTime({day : 6, hours : [8,12]});

// Make specific date a work day
gantt.setWorkTime({date : new Date(2013, 2, 31)});[/code]
Programmatically check if certain time is working time:

gantt.isWorkTime(date) //OR gantt.isWorkTime(date, timeUnit);
If second argument is not specified, gantt.config.duration_unit is used instead

Sample of usage:[code]gantt.templates.task_cell_class = function(task, date){
var css = [];

if(!gantt.isWorkTime(date, 'day')){
}else if(!gantt.isWorkTime(date, 'hour')){

return css.join(" ");


Related examples: /samples/09_worktime

3) Milestone support and custom task types
Described here viewtopic.php?f=15&t=20507&start=10

If you encountered any bugs or incompatibilities with dthmlxGantt 2.0, please post in this topic
dhtmlxGantt_v2.1.0_gpl.zip (599 KB)

Hello Aliaksandr,
I’ve just starter briefly exploring the javaplanner and dhtmlxGantt last week and first of all let me say that I’m really impressed with your gantt library and whole work all of you are doing around that dhtmlx components. This is really good stuff. Congratulations!

Going back to the gantt lib, I have some comments based on my recent testings.

The dhtmlxGantt 2.0 and dhtmlxGantt_2.1b_131230.zip seems to be working fine with typical MySQL dev. configurations like xampp has – that’s good.
Unfortunatelly, whenever you try to use it with the dedicated MySQL 5.5 or 5.6 servers that usually have the SQL mode set to strict by “

sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" “ – then it works only partially. Your SQLs are working fine there with updates of pre-existing task in tables, however your library is submitting some nonstandard INSERTs that are rejected by the MySQL with that clause. Basically, is you want to have to have it fully working with 5.5-5.6 MySQL, I found that it is necessary to disable/comment that “ #sql-mode=... ” clause in you’re my.cnf/my.ini server config file, which might not be an option in some production environments.
So, maybe you could consider making small adjustment of the dhtmlxGantt 2.x’s INSERT SQLs to make them compatible with the default my.cnf/my.ini settings of current MySQL servers – that would prevent a lot of issues for the future and other people.

The newly published beta of dhtmlxgantt_2.1b_140228.zip is not working for me at all.
I’ve simply swapped the codebase and sources folders in my simple test project from dhtmlxGantt_2.1b_131230 to that new ones and it doesn’t read any information from MySQL database any longer with this new beta libs of 140228 – even on relaxed XAMPP config, if show just empty grid with no task and no error messages, so there might be something going on with this new betas you might want to check further on this beta and database connectivity.

After someone is using the “gantt.config.order_branch = true;” and manually reordering the task on grid, then it would be nice to have also the option to save that new order permanently into database as well – I haven’t found such information in the docs – maybe you could advise?

Translation/locales activation by “” had no effect at v.2.0 in my case – everything was still in English. In beta 2.1-131230 the locales dir was missing completly and now it is still back in 140228, so after I’ve copied the locales from new beta to the previous-131230 it finally worked on that mix, however cause of p2 I’m unable to test it further with the clean beta140228.

Finally, it would be also good to have the skins.css files sources in more human readable format, then if someone would adjust one of them and create a new, flashy skin and share it – so, you could also benefit from that.

Thank you, Best Regards,

… and there is one more thing :wink:

I’ve just noticed that your localization for polish was still incomplete in that last beta, so here is my translation of that file “locale_pl.js” - if you like it, then just include that in your code.
locale_pl.rar (847 Bytes)

(1) I will look in this problem. Maybe you have some error log related to this issue ?

(3) It possible, but was not documented somehow. You need to

  • add integer field “sortorder” to the tasks table
  • add next line in php code before render_table


(5) Yep sure, we will add the uncompressed css to the final build.

Some updates with dhtmlxGantt v2.1 Beta

  • inverted ‘ignore_time’ return value. This made for consistency with similar api of dhtmlxScheduler. Column is omitted if method returns boolean ‘true’
  • simplified .changeLightboxType parameters. Lightbox can be changed by following call
  • fixed bug with drag-reorder grid rows, reported here
    docs.dhtmlx.com/gantt/api__gantt … 1268499912
  • updated Polish locale. TheUser, thank you for the feedback

The package in the topics head has been updated