jQueryMobile - SimpleDialog2

Home

jQuery Mobile Framework :: SimpleDialog

A Popup Dialog Box for jQueryMobile

Button API

When writing functions for each button, there are a number of widget methods available to you. They are all available in the keyword "this", which I prefer the convention of assigining to "self". e.g.:

jQuery
$(document).delegate('#opendialog', 'click', function() {
  // NOTE: The selector is the hidden DIV element.
  $('#inlinecontent').simpledialog2({ ...
    button: {
      'ok': {
        'click':
          function () {
            var self = this;
          }
....

Inside the self object, you will find the following:

  • Objects
  • displayAnchor

    A jQuery object that contains the calling element

  • internalID

    An integer definition used by this dialog. Used for cleanup and event namespacing

  • options

    A object that contains all the calling options (or the default)

  • screen

    A jQuery object that contains "screen", or full page element that sits behind the dialog - it can either fade the background, or just catch clicks outside the dialog

  • sdIntContent

    A jQuery object that contains the HTML of the body of the dialog (and the header in popup/fullscreen mode). You can change this directly, but it is here for search / replace operations really.

  • thisInput

    A variable that contains the value of the buttonInput field.

  • Methods
  • close()

    Closes (and destorys) the dialog.

  • updateBlank(--NewHTML--)

    Takes 1 argument, the new HTML for a currently open 'blank' mode dialog.

  • repos()

    Force the dialog to re-calculate it's on-screen position.

  • Arguments
  • arguments[0]

    The first argument (you can name it if you like), is the event that was called. Not sure why this might be helpful, but it is there.

  • arguments[1]+

    These can be set with the 'args' property - you can name them too if you like.