In this article we're telling you about things that seems us most necessary and useful for you. So called, top 10 of the most essential DHTMLX Touch helpers.
This method is alternative to onDocumentReady event and can be used instead of onload() method. Code, you put inside it, is called just after the page has been completely parsed protecting you from potential errors. The thing is optional but we recommend to use it.
Can be used multiple times.
dhx.ready(function(){ dhx.ui({ container:"box", view:"window", ... }); })
An easy way to bind a function to an object (inside bound function, this will point to an object instance).
var t = dhx.bind(function(){ alert(this); }, "master"); t(); //will alert "master"
The method makes a deep copy of an object
var a = dhx.copy(b)// prototype linked copy
The thing is for extending object's functionality.
var obj = new dhx.ui.toolbar(config); dhx.extend(obj, dhx.Movable);
Also, it's one more method to get an object copy. In such case, you must specify an empty object as the parameter obj.
var a = dhx.extend({},b) //object based copy
You can know more about usage of this helper here.
Our next helper allows you to execute code string at runtime.
dhx.exec(" var t = 2; ");
Delay routine. If you need to delay some code from executing at runtime you are at the right place. dhx.delay waits for the specified number of milliseconds and then executes the specified code.
dhx.delay(dhx.animate, dhx,[node,animation],10)
A tool for getting an unique id.
var name = dhx.uid();
Events. It's the thing we can't skirt around. dhx.event is used to attach event handler and dhx.eventRemove - to remove it.
var display_handler = dhx.event(document.body,'click',function(e){}) \\ dhx.removeEvent(display_handler);
With the help of this method you can get the position of any html element.
var obj = arguments[0] var offset = dhx.html.offset(obj)
Two methods implementing css manipulation. dhx.html.addCss lets to add css class to element, dhx.html.removeCss - removes some defined css class.
dhx.html.addCss(this._headbutton, "collapsed"); // dhx.html.removeCss(this._headbutton, "collapsed");