nosDialog

$container.nosDialog([method[, options[, ...]]])

Manages back-office’s popup. This is a function with sub-functions.

Arguments:
  • method (mixed) – The sub-function name, open (default) or close. If omitted this is the first parameter of the default sub-function nosDialog.open().
  • options (mixed) – Parameters of the sub-function.

nosDialog(‘open’)

nosDialog.open(dialog)

Opens a popup. This is a wrapper of Wijmo widget Dialog.

A popup can be created in three ways:

  • From an existing DOM element.
  • From an URL loaded into an iframe.
  • Form an URL loaded into a <div> from an AJAX request.

Catch events dispatched by $.nosDispatchEvent().

Arguments:
  • options (JSON) –

    JSON that configures the popup. Same as $.wijdialog() with some differences:

    Some defaults options:

    width:Container width minus 200 pixels.
    height:Container height minus 100 pixels.
    modal:True
    captionButtons:Buttons pin, refresh, toggle, minimize and maximize are hidden.

    Additional options:

    destroyOnClose:boolean. Destroys the popup when it’s closed. Default true.
    ajax:boolean. If true, contentUrl is loaded using AJAX rather than using an iframe. Default true.
    ajaxData:{}. Data passed to the AJAX request (if ajax is true).
// Popup containing the HTML result of the AJAX request on contentUrl
$(domContext).nosDialog('open', {
        contentUrl: 'path/url',
        ajaxData: {
                foo: 'bar'
        },
        title: 'title of the popup',
        height: 400,
        width: 700
});

// Same as previous, without first parameter, open is the default sub-function
$(domContext).nosDialog({
        contentUrl: 'path/url',
        ajaxData: {
                foo: 'bar'
        },
        title: 'title of the popup',
        height: 400,
        width: 700
});

// Popup containing an iframe width contentUrl href
$(domContext).nosDialog({
        iframe: true
        contentUrl: 'path/url',
        title: 'title of the popup',
        height: 400,
        width: 700
});

// Popup containing <div> with the id 'id_de_div'
$('#id_de_div').nosDialog({
        title: 'title of the popup',
        height: 400,
        width: 700
});

nosDialog(‘close’)

nosDialog.close()

Closes the current popup dialog (i.e. from the current js:data::DOM container <$container>).

$(domContext).nosDialog('close');