I tried modifiying the example given for the DHTMLX Scheduler fully customisable lightbox (docs.dhtmlx.com/scheduler/custom … _form.html) however it appears several methods such as “startLightbox” do not exist in the Gantt API.
Is it possible to implement a fully custom lightbox in the current version of DHTMLX Gantt?
Hi,
there is no such methods in gantt, but you may redefine gantt.showLightbox and gantt.hideLightbox methods. [code]gantt.showLightbox = function(id){
// display the details form for specific item
};
gantt.hideLightbox = function(){
//
};[/code]However, in this case you’ll have to manually implement displaying the modal popup and all logic of the form
Could you please give an example of how I can set form values that Gantt can work with?
[code]
[/code]
For example in a custom form how could I set the text of a new or existing task. I’ve studied the source but I can’t see how the default form is setting values that Gantt can use. Do I have to use a POST array or is gantt achieving this in another way?
Hi,
form is not expected to post values to the server.
The main idea is that you can define a form with any custom controls,
When the component need to display a lightbox, it calls gantt.showLightbox and passes the id of the related task as an argument.
If you redefine this method, you can display your own form and fill it with values of the provided task object.
When user clicks ‘save’ or ‘delete’ you can modify the task using a public API of the component . After that the component will display updated item and send changes to the server docs.dhtmlx.com/gantt/api__gantt_addtask.html docs.dhtmlx.com/gantt/api__gantt_updatetask.html docs.dhtmlx.com/gantt/api__gantt_deletetask.html