DictionaryBox.Save

Syntax

Save: function(sender, args: Object);

Parameters

sender. Event source.

args. Event information. Available arguments: ActiveSource - MDM dictionary to be saved.

Description

The Save event is fired on saving MDM dictionary data.

Example

To execute this example, the page must contain the DictionaryBox component named dictionaryBox (see Example of creating the DictionaryBox component ). Show the main menu items File > Save and File > Save As, and process the Save and SaveAs events:

// Get main menu settings
var menu = dictionaryBox._fileMenu;
// Get items of the File menu
var items = menu.getItems();
for (var i = 0; i < items.length; i++) {
    switch (items[i].getId()) {
    case "SaveMenuItem":
    case "SaveAsMenuItem":
        items[i].setIsVisible(true);
        break;
    }
};
// Process the Save event
dictionaryBox.Save.add(function (sender, args) {
    console.log("ID of the saved MDM dictionary: %s", args.ActiveSource.getId());
});
// Process the SaveAs event
dictionaryBox.SaveAs.add(function (sender, args) {
    console.log("Key of the saved MDM dictionary: %s", args.ActiveSource.getKey());
});

After executing the example the main menu items File > Save and File > Save As become visible. On selecting these items the browser console shows ID and key of the saved MDM dictionary due to firing the handlers of the Save and SaveAs events respectively:

ID of the saved MDM dictionary: TIME_UNITS

Key of the saved MDM dictionary: 8093

See also:

DictionaryBox