Event Content Update

Hi,
I want to update some child tables along with the event updation. How can i render my own query as updation SQL; How can handle event update and delete separately? Here i am attaching my code


if ($scheduler->is_select_mode()){ // ’ code for loading data
$SQL = "SELECT… ";
$scheduler->render_sql($SQL,“id”,“field1,field2,field3,field4,field5,field6”, “”, “”);
}
else { // code for other operations - i.e. update/insert/delete
$scheduler->render_table(“tableName”,“field1,field2,field3,field4,field5,field6”);
}


In the else part i am handling both update and delete together, actually i want to retrieve data from child table after updation. How can i do that? Please reply as soon as possible.

Thanks in advance
Shiju

You can redefine the sql code for any operation, or define your custom logic, what server side code must to do, when update command is received.

docs.dhtmlx.com/doku.php?id=dhtm … ex_updates

Actually update code is working, but after update the content is not populating correctly. Actually the update table got the foreign key which is get updated while drag n drop. I need to get the details with updated foreign key value.But only after refresh i can get that changes. What will be the problem? Please reply as soon as possible. I cant figure out what the actual issue yet now.

Thanks in advance
Shiju

Do you mean that after server side update you need to reload some custom value in client side event?

Yes, after server side updation i want to reload some custom value in client side event. This custom value can retrieved from child table only.

Help?

You can update custom properties of event without full reloading

check “Loading extra data” section of
192.168.1.251/dhtmlx/docs/doku.p … mmon_tasks

If you still plan to use data reloading, the next code can be used

dp.attachEvent("onFullSync",function(){ scheduler.clearAll(); scheduler.load(url); })

http://192.168.1.251/dhtmlx/docs/doku.php?id=dhtmlxdataprocessor:common_tasks

I am not getting above link.

Thanks
Shiju

Sorry, the correct link is
docs.dhtmlx.com/doku.php?id=dhtm … mmon_tasks

My server side code

if ($scheduler->is_select_mode()){ //then ’ code for loading data
$SQL = “”;
$scheduler->render_sql($SQL,“apmt_id”,“apmt_start_time,apmt_end_time,label,apmt_status,apmt_operatory_id,apmt_prov_id”, “”, “”);
}
else { //code for other operations - i.e. update/insert/delete
$scheduler->render_table(“tablename”,“apmt_id”,“apmt_start_time,apmt_end_time,apmt_operatory_id,apmt_prov_id”);
}

I hope the issue is with server side code because i cant see any query to retrieve data from operatory master table after updation. Please reply asap.

Please see the attachment.

Thanks in advance
Shiju


Please help on above issue asap.

Thanks in advance
Shiju

You can use

else { //code for other operations - i.e. update/insert/delete $scheduler->event->attach("onAfterUpdate",function($action){ $action->set_response_attribute("mydata", SOME_VALUE); }); $scheduler->render_table("tablename","apmt_id","apmt_start_time,apmt_end_time,apmt_operatory_id,apmt_prov_id"); }

Where SOME_VALUE - value which you want to send , back to client side.
And on client side you can use the code which is described by above link, to retrieve value from server and update event in question with it.

$action means??

mydata means??

apmt_operatory_id is get updated while drag n drop, i want to get operatory name from operatory master table using updated apmt_operatory_id get updated on drag n drop…

I hope you got the scenario? Sorry for my bad english

Thanks in advance
Shiju

$action - data action object, which wil be generated by connectors
docs.dhtmlx.com/doku.php?id=dhtm … ion_object
It contains info about incoming data and db operation.

mydata - just an unique name, will be reused on client side to get the value by the same name

want to get operatory name from operatory master table using
Connector itself can’t provide such info, you need to use custom sql request to fetch such data from DB

The above code part is not working in my server side code. Its showing error.

Is this client or server side code?

$scheduler->event->attach(“onAfterUpdate”,function($action){
$action->set_response_attribute(“mydata”, SOME_VALUE);
});

Please make it more clear. I am really stuck with this…

Thanks in advance.
Shiju

Yet now i cant get updated the fields after drag and drop.

I am again posting my server side code

if ($scheduler->is_select_mode()){
// $SQL : custom query for fetching data

$scheduler->render_sql($SQL,“apmt_id”,“apmt_start_time,apmt_end_time,label,apmt_status,apmt_operatory_id,apmt_prov_id”, “”, “”);
}
else {

// I hope this else part working after drag and drop. Here the apmt_operatory_id get updated on drag n drop but its corresponding values is not getting from child table. I can see clearly that custom SQL statemement to fetch data after updation is not here. Please explain in detail, how can i do this? I am almost in last stage of customization, this is the only issue yet now i cant figured out. So please help Stanislav.

  $scheduler->render_table("appointments","apmt_id","apmt_start_time,apmt_end_time,apmt_operatory_id,apmt_prov_id");
}

Please let me know what my mistake.

Thanks in advance
Shiju

Please help me to get out of this problem.

Thanks in advance.
Shiju