Dhtmlx Scheduler

Hi i’m french,

I have two: tables agenda_calendrier and agenda_evenement. An event belongs to a calendar.


When I try to create an event, I get this error :s :

this.obj.rowsAr is undefined

dhtmlxsc…_debug.js (ligne 1523) if (!this.obj.rowsAr[rowId])\r\n

I use postgresSql. Any idea?


Please try to update js file to attached one.
( most probably the issue was caused by the problem in debug version of code )

codebase_scheduler.zip (45.7 KB)

Thank you for this answer, but I have this in log now:

row 1246535792165 marked [inserted,valid]

 Initiating data sending for 1246535792165
 Initiating data sending for all rows
 Sending all data at once
 Server url: calendrier/Event?editing=true parameters
1246535792165_start_date=2009-7-1 08:45
1246535792165_end_date=2009-7-1 11:40
 Server response received details
version=‘1.0’ ?>
 Action: error SID:1246535792165 TID:1246535792165
 row 1246535792165 unmarked [updated,error]

But I always block on this error which remains very vague. I think that it comes of calendrier_id which is a foreign key.


When you creating new event, it will generated insert query only for “date_deb,date_fin,nom” and if you DB has constraints - it may block insert operation without foreign key specified.

You can
a) enabled server side logging and check exact DB response
$scheduler = new schedulerConnector($res);

b) you can use server side events to add extra fields in query
function some_code($action){

where SOME_VALUE - value which need to be used as foreign key

Here is my code with the modifications, I always have the same error

   public function executeEvent(sfWebRequest $request)

              include (‘connector/scheduler_connector.php’);

        $res=pg_connect(“host=localhost port=5432 dbname=w3box user=w3soft password=password”);
        $scheduler = new schedulerConnector($res);
        return sfView::NONE;
   public function some_code($action)

I am spirit of integrated the schedule has a framework: Symfony ^^ but it’s not very easy.

Thank you for your answers.

a) You need to change the order of commands


render_* method must be the last command to the connector ( all commands after that point will be ignored )

b) please be sure that “some_code” function is visible from executeEvent context

c) used syntax is common for simple functions, if you are working with objects , you can use

Thank you very much I have the display and the update which works but always not the insert    :s

I don’t know how to test the class som_code because I call it ajax there.

Thank you for your answers.

What is the content of “log.txt” in case of problematic operation?

>>I don’t know how to test the class som_code because I call it ajax there.
Assuming, that you are using connectors 0.9
Comment next lines in base_connector.php

lines 13-14

line 255

without them - any error info , generated to php , will be included in server side response. ( which can be checked by firebug-like plugin, or through “response” link in debug version of script )

Everything’s working very well ^^ thank you very much.
The insert is working, but i can’t update if i don’t reload the page.


The insert is working, but i can’t update if i don’t reload the page.
Is problem occurs only for newly added records? In such case, most possible, that server side doesn’t return correct new ID after insert operation. ( you can use debug js file and check the action@tid in insert response - it must be a new ID )
Such problem must not occur for default insert operation, but if you are using custom SQL or PHP logic for new record adding - you need to provide info about new record as well

function some_other_code($action){

Where $id - id of newly added row.


i’d like to make a multi-table request now: here is my database:

        id:                   ~
        user_id:              { type: integer, required: true, foreignTable: sf_guard_user, foreignReference: id }
        nom:                  { type: varchar(255), required: true }
        description:          { type: longvarchar }
        type:                 { type: boolean, required: true, default: 0 }
        libelle:              { type: varchar(255) }
        default_cal:              { type: boolean, required: true, default: 0 }
        created_at:           ~
        updated_at:           ~
        id:                   ~
        calendrier_id:        { type: integer, required: true  }
        id_parent:            { type: integer }
        nom:                  { type: varchar(255) }
        adresse:              { type: varchar(255) }
        description:          { type: varchar(255) }
        date_deb:             { type: timestamp, required: true }
        date_fin:             { type: timestamp, required: true }

Is this possible to display all the events of a user, or the events of some calendars, or just one calendar?

Freedom’s coming after that =)

Instead of render_table method of connector, you can use render_sql

$sched->render_sql("SELECT *, b.id as event_id FROM agenda_calendrier a INNER JOIN agenda_evenement b ON a.id = b.calendrier_id WHERE some rules here ", “event_id”,“date_deb,date_fin,description”)

In such case the code will select dataset based on provided SQL query and output it to client side in correct format.
In case of render_sql usage, component will not be able to create insert|delete|update operations automatically, so you will need to redefine them through sql code or through events.