Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Joey Crone on Jan 08, 2010 14:51
open dhtmlx forum
dhtmlx widows user button event

I am having trouble attaching events to user buttons. I was able to successfully add a button to the window using the following code:
dhxWins.window(id).addUserButton(id, position, tooltip, name);

Next I tried to attach an event to the button using this code:
dhxWins.window(id).button(id).attachEvent("onClick", handler);

When this line of code is initialized the handler is executed (not the desired behavior), but the event is not attached. Nothing happens when the new button is clicked. (Other than the visual change defined in the css).

Please tell me what js files are required for these methods, an example/sample of the user button in use would be very helpful.
Any suggestions why this code is not working correctly?
Answer posted by Alex (support) on Jan 11, 2010 09:42

Please have a look at the sample:

in window package dhtmlxWindows/samples/06_buttons/03_userbtn.html

on website http://www.dhtmlx.com/docs/products/dhtmlxWindows/samples/06_buttons/03_userbtn.html