Dialogs

Two most frequnt dialogs are alert and cofirm. In the case of a alert you just need to display a message to the user and require no feedback besides user acknowledgement. Confirm dialog has similar purpose, but expects from the user a response by accepting or declining the message. The w2ui library includes these dialogs for your convenience.

w2alert (msg, [title], [callBack])

The alert dialog can be called in the following way: First argument, msg, is a message to display. Second optional argument, title, is the title for the dialog. The third optional argument, calBack, is a call back function when dialog is closed.

w2confirm (msg, [title], [callBack])

The confirm dialog can be called in the following way: The method takes up to three arguments w2confirm(msg, [title], [callBack]), where msg is the message to display. You can optionally supply title for the message and a call back function.

w2confirm (options)

You can optionally call w2confirm passing an object with options. This options object has following structure: For convenience, w2confirm will return to you an object with yes() and no() methods that you can use in the following way:

User Comments

comments powered by Disqus