Replacing the alert, confirm and
prompt dialog boxes provided by the browser
RadWindow provides an easy way to
replace the standard dialog boxes provided by the browser when calling the
window.alert(), window.prompt() and
window.confirm() commands.
At present the dialog boxes are
called with the radalert, radprompt and
radconfirm methods
RadWindow popups bring the following advantages over the standart browser
popups:
- full customization of the window look to blend into the design of the
site, thus increasing usability.
- completely arange and change the
positioning and the elements (icon, text, buttons) in the popup, from the
RadControls/Window/Skins/CURRENT_SKIN/CoreTemplates.xml file.
- control the
initial size of the popup by providing width and height as extra
parameters.
- set HTML as content for a richer user
experience.
Note: Since the RadWindow popus are non-blocking, it is
necessary to provide a callback function for the prompt and
confirm popups in order to receive their
result.
<button
style="width:150px"
onclick
=
"radconfirm('Are
you sure?', confirmCallBackFn); return false;">SHOW CONFIRM BOX</button>
Note: The RadWindow dialogs are modal, e.g., they block the
content underneath and prevent the user from interacting with it, but there are
ways to work around this behavior. If it is absolutely necessary that a popup is
modal, then the default browser popups should be used.