Categories

.customformUiCustomform()

Categories: UI

.customformUiCustomform( [ options ] )

Subclass: de_epages

Inherit: (Subclass: de_epages) .widget()

Plugin: de_epages.customform.ui.customform

Description: Open a dialog to edit custom form fields.

  • .customformUiCustomform( [ options ] )

    version added: 6.15.0

    options   A map of additional options pass to the method.

The .customformUiCustomform() method opens a dialog when the element is clicked. The dialog can be used to edit new custom form fields. The element has to contain two data attributes, data-formfieldid (representing the ID for the form field type, e.g. textarea, select ..) and data-objectid (representing the ID of the existing form field).

  • Edit a existing custom form field

    HTML:
    <a href="#" class="editCustomField" data-formfieldid="5094" data-objectid="16211">Feldname</a>
    
    Code:
    
    de_epages('.editCustomField').customformUiCustomform({
        width: 800,
        height: 400,
        languageId: 1,
        languages: {'2' : 'English', '1' : 'Deutsch'},
        afterSaveDialog: function(widget, data){
            console.debug(widget, data);
        }
    });
    
    
  • width

    version added: 6.15.0

    An integer representing the width of the dialog.

    Default: 800

  • height

    version added: 6.15.0

    An integer representing the height of the dialog.

    Default: 400

  • languageId

    version added: 6.15.0

    An integer respresenting the ID of the currently active language.

    Default: 1

  • languages

    version added: 6.15.0

    A object representing the languages (id-name pairs, e.g. {'2' : 'English', '1' : 'Deutsch'}).

    Default: {}

  • afterSaveDialog

    version added: 6.15.0

    Callback function which is called after the new form field values were successfully saved.

    Default: undefined