DHTMLX Touch simplified creating alert and confirm messages by means of 2 commands: dhx.alert() and dhx.confirm().
Let's know how to use them.
By calling this command you create alert window (exists in the only copy).
dhx.alert({ title: "Close", message: "You can't close this window!", callback: alert2 }) function alert2() { dhx.alert("You closed me") }
There is the other way to call this command.
dhx.alert("AlertText");
It's analogous to the following calling statement:
dhx.alert({ title: "Info", message: "AlertText", width: 300,// the default width value height: 200, // the default height value position: "center", // the default text alignment callback: "" })
By calling this command you create confirm window (exists in the only copy).
dhx.confirm({ title: "Close", message: "Are you sure you want to do it?", callback: function(result) { if (result) dhx.alert("You have select 'Ok'"); else dhx.alert({ message:"You have select 'Cancel'", callback:function(){ dhx.confirm("Still want to try?"); } }); } });
You also have the other way to call this command:
dhx.confirm("ConfirmText");
It's analogous to the following calling statement:
dhx.confirm({ title: "Info", message: "ConfirmText", width: 300,// the default width value height: 200, // the default height value position: "center", // the default text alignment callback: "" })