add employees from a new data table

I have added a table employees of database your original.
in the gantt_tasks table I have added a field to create a new link to the Employees table.
when adding a new project, I want from the new link I can get the name and assign work to staff. Because I want the management of employee information.


I’ve tried to read and follow the documentation but not achieve the desired results. I would like get your help to solve this problem
demo and new database
mediafire.com/download/bq1n2 … lpcode.zip

Hello,
you can fetch options via ‘OptionsConnector’.
On the client-side the options should be defined with ‘gantt.serverList’ method:

{name: "user", height: 22, map_to: "user", type: "select", options: gantt.serverList("persons", [])}, And loaded from the server with the rest of the data

[code]<?php

include (‘config.php’);

$gantt = new JSONGanttConnector($res, $dbtype);

$gantt->mix(“open”, 1);
//$gantt->enable_order(“sortorder”);

$list = new JSONOptionsConnector($res, $dbtype);
$list->render_table(“gantt_employees”,“person_id”,“person_id(value),full_name(label)”);

$gantt->set_options(“persons”, $list);

$gantt->render_links(“gantt_links”, “id”, “source,target,type”);
$gantt->render_table(“gantt_tasks”,“id”,“start_date,duration,text,progress,parent”,“”);

$gantt->enable_order(“sortorder”);[/code]
gantt_employee.zip (592 KB)

thank you for help!
but an error is occurring. I can’t update to the project staff.
person_id not updated as new changes in form.

And I want to check the conditions of employees

$list->render_table("gantt_employees","person_id",[b]"deleted" == 1,[/b] "person_id(value),username(label)");

because staff have been banned in system.
I dont want to show staff were prohibited (in the database “deleted = 1”) when creating a new project or task.
I have tried the above command but empty screen

Try to use the code like next

$list->render_sql("select person_id as value, username as label from gantt_employees where "," deleted <> 1", "value", "value, label");

you need to configure mapping of employee selector and load ‘person_id’ with the rest of data properties. Try update connector file with following code, note that ‘person_id’ column has been added to connector configuration: $gantt->render_table("gantt_tasks","id","start_date,duration,text,progress,parent,person_id(user)","");

thank you!
thank you very much!
My problem has been overcome.
sorry bother your time.

I have tried many ways but does not bring the desired results


i add header('Content-Type: text/html;charset=UTF-8'); in the headers.
format of my database is utf8_unicode_ci.
for example my content:

on the form will display:

or null as shown image on

Please check the next

a) page shown in browser as utf ( check in Tools | Encoding )
b) the collation of is really set to utf ( collations can be set directly on tables and fields, so utf db can have separate tables in different collation )

I’m sure I’ve used

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

in header.
in the database is style Charater Set utf
Please see the file and database attached below
mediafire.com/download/lbd2q … _utf-8.zip

I have used your code and SQL dump locally, and it does generate valid output
screencast.com/t/deaXqa6M8

i added more a table gantt_employees to save the name of my staff
but name staff faulty


data new: mediafire.com/download/lbd2q … _utf-8.zip

Try to add the line like next before connector initialization

mysql_query("set character_set_results='utf8'");

about the name staff issue has been overcome
but the text of the project - task fails

I want to display the employee outside interface
here is the code but I only get ID

gantt.templates.rightside_text = function(start, end, task) {
    return "ID: #" + task.user;
 };

in paragraph tags after I have more properties disabled:“disabled” or disabled:true or readonly but no effect

{name: "user", height: 22, map_to: "user", type: "select", disabled:"disabled", options: gantt.serverList("persons", [])}, {name: "template", height: 16, type: "template", map_to: "my_template", disabled:"disabled"}, {name: "time", height: 72, type: "time", map_to: "auto", time_format: ["%d", "%m", "%Y", "%H:%i"], disabled:"disabled"},

About text encoding - it seems that user names and task names are stored in different encodings, one is UTF, second is iso-8859-1 encoded string, stored as utf.

As for converting id to the related text, you can use getLabel API inside of template.
docs.dhtmlx.com/gantt/api__gantt_getlabel.html

please help me fix font anh add properties disabled

{name: "user", height: 22, map_to: "user", type: "select", disabled:"disabled", options: gantt.serverList("persons", [])},

please help me fix this problem. I tried but could not surmount :cry:

You need to change the code of existing form section, or create a new one.

docs.dhtmlx.com/gantt/desktop__c … ditor.html

To minimize the work, you can copy paste code of “select” section with new name and adjust the aspects that need to be changed.