DEMOS
DOCS
FEATURES
DOWNLOAD
PURCHASE
CONTACT
BLOG
Show:

jsPlumbToolkit.Dialogs Class

A library for providing simple dialogs to use with an instance of the jsPlumb Toolkit.

Item Index

Methods

Methods

hide

() static

Hide the current dialog as if the cancel button was pressed.

initialize

(
  • params
)
static

Initialize all the dialogs found on the page.

Parameters:

  • params Object

    Method parameters

    • [dialogs] Object optional

      Optional map of dialog IDs to [content, title, isCancelable] arrays. Use this instead of providing a selector if you wish to supply dialog information via JS and not as templates in the HTML.

    • [selector='.jtk-dialog'] String optional

      Selector identifying dialog elements. If not provided, the value '.jtk-dialog' is used by default.

    • [globals] Object optional

      Optional object of global callbacks, keyed by event id.

    • [labels] Object optional

      Optional object of button labels. See documentation.

show

(
  • params
)
static

Show the dialog with the given id, optionally rendering it with some provided data.

Parameters:

  • params Object

    Method parameters

    • id String

      ID of the dialog to show

    • [data] Object optional

      Optional data to render the dialog template with.

    • [title] String optional

      Title for the dialog. If not supplied, the dialog's title will come from the title attribute of the associated template, if any. Otherwise it will be blank.

    • [onOpen] Function optional

      Optional function to run once the dialog has opened.

    • [onOK] Function optional

      Optional function to run when the user presses OK.

    • [onCancel] Function optional

      Optional function to run when the user presses cancel.

    • [onClose] Function optional

      Optional function to call when the dialog is closed, regardless of how it was closed.

    • [onMaybeClose] Function optional

      Optional function that will be called prior to onOK being called, with the same data that will be passed to onOK. Returning false from this function causes the dilaog to remain open.