Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Adrian Labastida on Jun 05, 2008 11:56
open dhtmlx forum
DettachEvent on Combo

Hello, how can i remove an event already asigned to a dhtmlxCombo?

Im in the need of removing the onchange event because i need to reset the combo values at certain point, but if i dont remove the onchange event it fires up when i dont need it to do that.

How can i remove the event from the object?

I tried using combo.detachEvent("onChange"); but it didnt worked.

Thanks.

PS.

I attached the event in this way:
combo.attachEvent('onChange', my_function);
Answer posted by Support on Jun 06, 2008 01:46
When event attached, code return event's ID
    var id = combo.attachEvent("onChange",some)
This id can be used to detach the same event later
    combo.detachEvent(id)

http://www.dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Cust_code_in_events.html#grid_attccodeevents