I’ve a PHP Codeigniter app using dhtmlxScheduler with scheduler_connector.php and db_phpci2.php integration.

I’ve seen that when I insert a new event the DHTMLX Scheduler makes an XHR call to get_events function of ther controller but adding the ?editing=true parameter.
Example: … iting=true

Why inserting a new event needs to call get_events? My get_events function executes a heavy SQL function that return all the events of the scheduler and it’s slow.


Actually it happens editing and deleting events too!

A possible fix is returning an empty array when ‘editing’ parameter is set:
if ($this->input->get(‘editing’)) $events = array();

[code]public function get_events()
DataProcessor::$action_param =“dhx_editor_status”; // Necessari per integració amb CI

if ($this->input->get(‘editing’)) $events = array();
else $events = {method that SELECT all the events of the scheduler…}

    $conn->render_array($events, ..., ...);


But I’ll preffer to understand why this happens

Any information?

Most probably, you have a code like next on a client-side.


var dp = new dataProcessor(url);

First lines enable data loading logic, last lines enable data saving logic.
When data is changed, component will make the post request to the url defined in the dataProcessor constructor ( it will add “editing” parameter to url as well )

So if you need not data saving call ( you are processing data saving through some kind of custom logic ), just remove dataProcessor initialization.

Yes, my client side code is like that, with a setLoadMode just before init and loading at end:

scheduler.init() scheduler.setLoadMode('month'); var dp = new dataProcessor(url); dp.init(scheduler); scheduler.load(url);
If I remove the dataprocessor lines the scheduler doesn’t save modifications, so I need it.

I can’t understand why you use the same url for loading and the dataprocessor. It will be loading events from database both for load() and for saving events, and with this last case we don’t need it, isn’t it?