How to create a message box?
DHTMLX Touch simplified creating alert, confirm and notice messages by means of 3 commands:
The commands in question can be used in two ways:
Please note, created windows:
Related sample: 08_window/07_confirm.html
Related sample: 08_window/08_alert.html
Related sample: 08_window/09_notice.html
As buttons used in confirm and alert windows are standard controls (button), you have a possibility to define the appropriate attributes for them.
To define the desired attribute you should refer to button as:
$$('dhx_confirm_ok').define('inputWidth', 100); $$('dhx_confirm_ok').render();
You can change text of message box (parameter message) out of constructor. This can be achieved in the following way:
dhx.confirm({ message: "Are you sure?", id:"winId"}) $$('dhx_confirm_message').define('label',"new message"); $$('winId').refresh(); //or dhx.alert({ message: "Warning!", id:"winId"}) $$('dhx_alert_message').define('label',"new message"); $$('winId').refresh();
By calling this command you create an alert box.
dhx.alert({ title: "Close", message: "You can't close this window!", callback: someFunction })
dhx.alert("AlertText");
By calling this command you create a confirm box.
dhx.confirm({ title: "Close", message: "Are you sure you want to do it?", callback: someFunction });
dhx.confirm("ConfirmText");
By calling this command you create a notice box.
dhx.notice({ message: "Sorry, an error has occured!", css:"error", delay:2000 })
dhx.notice("Sorry, an error has occured!");
Related sample: 08_window/07_confirm.html
Related sample: 08_window/08_alert.html
Related sample: 08_window/09_notice.html