Dear Colleagues,
I have a problem with the readonly property.
My problem is to have the whole gantt chart set to readonly, done by
gantt.config.readonly = true;
I want to have several tasks editable.
I know you have to set the editable property of the task to boolean true. I can set up the readonly property on runtime no problem.
But MySQL 5.5.33 utf8 does not take boolean.
I tried thus, using tynint(1), but I can not get the readonly property to work.
Column name Datatype
readonly Tynint(1)
My dhtmlx gantt is 4.0.
How can I set up my database to work properly?
what is the datatype and that I must use?
Help is much appreciated.
Sten
#2
Hello.
You could handle beforeProcessing and beforeRender in connector to correct readonly values.
See articles:
docs.dhtmlx.com/connector__php__ … event.html
docs.dhtmlx.com/connector__php__ … event.html
Possibly, something like following:
$gantt = new JSONGanttConnector($conn, "MySQLi");
$gantt->enable_log("log.txt");
function setDefaultReadonly($action){
if(!$action->get_value("readonly"))
$action->set_value("readonly", 1);
}
function renderReadonly($row){
$val = $row->get_value("readonly") == "0" ? false : true;
$row->set_value("readonly",$val);
}
$gantt->event->attach("beforeProcessing","setDefaultReadonly");
$gantt->event->attach("beforeRender","renderReadonly");
$gantt->render_links("gantt_links", "id", "source,target,type");
$gantt->render_table("gantt_tasks","id","start_date,duration,text,parent,readonly","");
Dear Sten,
It did the work all right.
I just have some qualms about doing this, rather than have a proper patch for the app to accept 1 and 0 as true and false.
But it is such a small issue that it may not worth the trouble.
Thank you very much for your help.