Pretty often you need to execute different actions on button click. It can be window opening, data processing or whatever else.
That's why, during development we paid to this topic individual attention and simplified the process as possible: added a new button's parameter - click.
So, all you need now is to set this parameter to the desired function.
Let's take an example: a simple window with the button 'Close'.
On the button click - the window will be closed.
<body> <script type="text/javascript" charset="utf-8"> dhx.ui({ view:"window", head:{ view:"toolbar", type:"SubBar", data:[ { type:"button", label:"Close", align:"right", click:"close_window" } // in the 'Click' parameter we wrote the name of the function (defined later). ]}, body:"", top:100, left:100 }); function close_window(){ this.getParent().close(); } </script> </body>