showDiff: Text compare API for comparing properties
This API is used to display differences between any property or text in an easy to interpret way in a dialog box that consists of two panes. The left pane that contains the current value is editable, and the right pane contains the reference value that the current value is being compared with. Changes are shown live as you edit the contents of the left pane.
The API does not save the text. After you click
in the dialog box, the updated content from the left pane is passed to the callback function for users to perform any action.
The pega.ui.compare module is available for every harness.
pega.ui.compare.showDiff(event, language, fetch, currentString, compareString, propertyName, currentLabel, compareWithLabel, doneCallback, cancelCallback, ruleClass);
- language: The format of the compared strings. The available values are:
- fetch: If you are directly passing a string value in the currentString and compareString parameters, set this parameter value to
'string'. If you want the API to open the rule and retrieve the property value, set the parameter value to
inskey and provide the
inskey values of the rules to be compared in currentString and compareString parameters.
- currentString: Property value or
inskey of the current rule.
- compareString: Property value or
inskey of the compared rule.
- propertyName: If the value of the fetch parameter is
inskey, the name of the property to be compared after opening the rules. Otherwise, set as empty.
- currentLabel: Header label of the left pane in the compare dialog box.
- compareWithLabel: Header label of the right pane in the compare dialog box.
- doneCallback: Callback function to be called after clicking in the dialog box. An updated string is passed to this callback.
- cancelCallback: Callback function to be called after clicking in the dialog box. An updated string is passed to this callback.
- ruleClass: pxObjClass value of the rule that is being compared for example Rule-Obj-Activity.
Published September 18, 2017 — Updated October 16, 2017