tag.getAttribute not working

My update one works but my delete doesn’t

Only difference is that the delete confirmation comes up before this action. (which is another problem too because
I’m not able to set scheduler.locale.confirm_deleting to disable the confirmation and don’t see a local.js)

Using CodeIgniter to set the tag

-D

event_model.php - CI

217 function delete($action){
218
219 $cr = $action->get_value(‘cancel_reason’);
220 if ($cr == “”){
221 $action->invalid();
222 $action->set_response_attribute(“cancel_reason”,“Cancel reason required”);
223 return false;
224 }
225
226 $event_id = $action->get_id();
227 $this->db->update(“events”, array(‘active’ => 0), array(“event_id” => $event_id));
228 $this->log($action, ‘delete’, $event_id);
229 $action->success();
230 $connector->render();
231 }


scheduler.php

380 dp.attachEvent(“onAfterDelete”, function(sid, action, tid, tag){
381
382 var message = tag.getAttribute(“cancel_reason”);
383 if (message) {
384 dhtmlx.message(message);
385 scheduler.load("/scheduler/data");
386 }
387
388 });

I solved my problem. The getAttribute was working but only the onAfterUpdate trigger works. The onBeforeEventDelete or other events are useless. Just tet the attribute in the onAfterUpdate and it works.

-D

function delete($action){

 $cr = $action->get_value('cancel_reason');
 if ($cr == ""){
     $action->invalid();
     $action->set_response_attribute("cancel_reason_text","Cancel reason required");
     return false;
 }

dp.attachEvent(“onAfterUpdate”, function(sid, action, tid, tag){

 var message = tag.getAttribute("cancel_reason_text");             
 if (message) {                                                    
     dhtmlx.message(message);                                      
     scheduler.load("/scheduler/data");                            
 }                                                                 
                                                                   
 message = tag.getAttribute("event_name");                         
 if (message) dhtmlx.message(message);                             
                                                                   
 message = tag.getAttribute("division");                           
 if (message) dhtmlx.message(message);                             
                                                                   
 if (action == "update")                                           
     scheduler.load("/scheduler/data");                            

});