jQueryMobile - SimpleDialog
HomeConfiguration
- Options
mode
Purpose: Mode of operation
Default: 'bool'
Options: 'string', 'bool', 'blank'prompt
Purpose: Prompt to the user
Default: 'Are you sure?'cleanOnClose
Purpose: Completely remove simpledialog from the DOM on close - great for single use dialogs.
Default: falseclickEvent
Purpose: The event to bind buttons to.
Default: 'click'subTitle
Purpose: A second line of prompt to the user, always in the content section
Default: falsefullHTML
Purpose: In conjunction with blank mode, the HTML to use in the dialog
Default: nullinputPassword
Purpose: Use password style input for string mode
Default: falseThemeing
- Named Themes
pickPageTheme
Purpose:Theme for popup window or dialog
Default: 'b'
Modes: allpickPageButtonTheme
Purpose:Theme for widget buttons
Default: 'a'
Modes: allpickPageInputTheme
Purpose:Theme for widget input elemets
Default: 'e'
Modes: all- Other Display Options
zindex
Purpose:Z-Index for popup
Default: 500
Modes: alltop
Purpose:Position of top, in pixels
Default: undefined
Modes: allleft
Purpose:Position of left, in pixels
Default: undefined
Modes: all
User Interface
useDialogForceTrue
Purpose:Boolean *Always* use Dialog Window, regardless of screen size
Default: false
Modes: alluseDialogForceFalse
Purpose:Boolean *Never* use Dialog Window, regardless of screen size
Default: false
Modes: allfullScreen
Purpose:Use full screen (not a dialog) mode, when small screen size, in place of dialog
Default: false
Modes: allfullScreenAlways
Purpose:Use full screen (not a dialog) mode, *always* - fullScreen must also be true.
Default: false
Modes: alluseModal
Purpose:Use modal styling (background fades out) on popup
Default: false
Modes: allforceInput
Purpose:Force the user to pick something, don't close on outside click
Default: false
Modes: allallowReopen
Purpose:Allow the dialog to reopen
Default: true
Modes: allenterToTrigger
Purpose:Button to trigger when enter pressed in input box
Default: 0
Modes: stringescToTrigger
Purpose:Button to trigger when escape pressed in input box
Default: 1
Modes: stringtransition
Purpose:Transition style between dialog and page
Default: pop
Modes: allanimate
Purpose:Use animation between dialog and page (and modal fader)
Default: true
Modes: all
Buttons
- 'buttons' is an object containing the following options for each button
click
Purpose: Function to perform when 'click'ing the button. Return false to leave dialog open (or set closeOnClick)
Default: nullicon
Purpose: Icon to use on button
Default: 'check'theme
Purpose: Theme to use for button
Default: pickPageButtonTheme from abovecloseOnClick
Purpose: This button will close dialog if click function returns true
Default: trueid
Purpose: The id of the button
Default: nullhidden
Purpose: Hide the button by default
Default: falseinsertSeparator
Purpose: Insert a div seperator after the button
Default: false
Callbacks
- Callbacks are functions to be run when certain things happen
onCreated
When: Runs when the dialog is created
onOpened
When: Runs when the dialog is opened
onClosed
When: Runs when the dialog is closed
onShown
When: Runs when the dialog is opened, after the animation finishes
- Working with dialogs
butObj
Contains an object of the buttons.
Example: $('element').data('simpledialog').options.butObj[0].trigger('vclick');sawOnce
Contains a boolean that is used on forceinput. Set to false to override and allow one more reopen.
$('element').attr('data-string');
Contains the string that the user typed - Note that this does absolutly no validation, do that yourself.