cleanUp(dict: PP.Rds.Dictionary, conditions: Object, callback: function|PP.Delegate);
dict. MDM dictionary.
conditions. Conditions of dictionary elements clearing. The parameter is a JSON object, that may contain the closeDate - element validity date.
callback. Callback function.
The cleanUp method cleans up dictionary.
To execute this example, the page must contain the DictionaryBox component named dictionaryBox (see Example of creating the DictionaryBox component ). Clear all dictionary elements with the validity date 2013-10-30, and handle the RdsCleaned event:
var source = dictionaryBox.getSource()[0]; // Get service to work with the dictionary var service = source.getPPService(); // Process the RdsCleaned event service.RdsCleaned.add(function (sender, args) { console.log("The %s dictionary is cleared", args.Dictionary.getName()); }); // Clear only the dictionary elements with the relevance date 30.10.2013 var conditions = { conds: { Item: [] } }; conditions.closeDate = "2013-10-30"; // Clean the dictionary based on specified condition service.cleanUp(source, conditions, function () { // Refresh dictionary elements tree dictionaryBox.getDataArea().getActiveDictTree().refreshAll(true); });
After executing the example all dictionary elements with the validity date 2013-10-30 are cleared.
After the handler of the RdsCleaned event is fired, the browser console shows notification on the dictionary cleaning:
The Time Units dictionary is cleared
See also: