clear()
Returns: (Object) - Rule Editor instance
Removes all elements of the current rule from the Rule Area.
Parameters
deleted(..)
Returns: (Object) - Rule Editor instance
Calling this function after deleting a rule is necessary to clear editor's cache and remove the deleted rule from the Rules menu (if the Toolbar is displayed) and context menus.
Parameters
- id (
String) - ID of the rule that is being deleted. This parameter is required.
disable()
Returns: (Object) - Rule Editor instance
Prevents users from adding new rules or modifying the rule currently loaded in the Rule Area.
Parameters
var editor = $ce("divEditor");
editor.disable();
dispose()
Returns: (Object) - Rule Editor instance
Disposes all resources used by Rule Editor and removes it from the current context.
Parameters
enable()
Returns: (Object) - Rule Editor instance
Restores ability to add new rules or modify the rule currently loaded in the Rule Area.
Parameters
extract()
Returns: (String) - JSON string
Returns a JSON string containing the current rule and a value indicating whether it is valid. If the Rule Area is empty, returns an empty JSON.
Parameters
isAltered()
Returns: (Boolean)
Returns true if the user has modified an existing rule after it was loaded into the Rule Area or a new rule after its creation was initiated. Otherwise, returns false.
Parameters
isEmpty(..)
Returns: (Boolean)
Returns true if the Rule Area currently contains no rule elements. Otherwise, returns false.
Parameters
- includeFormattingElements (
Boolean) - Indicates whether formatting elements of the rule, such as tabs and new lines, should be counted. Optional. Default value is true.
isEvaluationType()
Returns: (Boolean)
Returns true if the loaded rule is of the evaluation type or if the rule author selected the New evaluation-type rule option from the Rules menu of the Toolbar. This function does not check which rule elements the author has added to the Rule Area so far.
Parameters
getRuleId()
Returns: (String) - String value of the Rule ID (.NET System.Guid)
Returns the string ID of the current rule assigned by the Rule Editor. The editor generates new rule IDs by calling .NET’s System.Guid.NewGuid().ToString(). Returns null if no rules have been loaded into the editor, if the current rule has not yet been assigned an ID, or if the Rule Area is empty.
Parameters
loadInvalids(..)
Returns: (Object) – Rule Editor instance
Call this function to load invalid rule elements into the Rule Editor.
Parameters
- data (
String) - JSON string received from the GetClientInvalidData() method of the CodeEffects.Rule.Editor.Control .NET class. Fork the related demo project to see how to load invalid rule data into the Rule Editor. This parameter is required.
loadRule(..)
Returns: (Object) – Rule Editor instance
Call this function to load a rule into the Rule Editor.
Parameters
loadSettings(..)
Returns: (Object) – Rule Editor instance
Call this function to load the Rule Editor client settings. You should also call it whenever the rule author changes any of the editor’s settings, such as the visibility of the Toolbar, Help String, and similar options.
Parameters
saved(..)
Returns: (Object) – Rule Editor instance
Call this function after saving a new rule or updating an existing one to refresh the Rules menu of the Toolbar and context menus of the editor with the new or updated values.
Parameters
- id (
String) - ID of the rule that has been saved or updated. This parameter is required for new rules and optional for updates.
setClientActions(..)
Returns: (Object) – Rule Editor instance
Call this function during page initialization to specify which functions the Rule Editor should call when the rule author wants to load, delete, or save a rule. Do not call it if the Toolbar is disabled.
Parameters
- loadCallback (
Function) - Callback function that handles loading a rule. This function must declare a single parameter of type string. The Rule Editor calls this function and passes it the rule ID when the rule author selects that rule from the Toolbar’s Rules menu. This parameter is required.
- deleteCallback (
Function) - Callback function that handles deleting a rule. This function must declare a single parameter of type string. The Rule Editor calls this function and passes it the rule ID when the rule author clicks the Delete button on the Toolbar. This parameter is required.
- saveCallback (
Function) - Callback function that handles saving a rule. This function must declare a single parameter of type object. The Rule Editor calls this function and passes it an object containing the rule data when the rule author clicks the Save button on the Toolbar. This callback works in tandem with the LoadClientData() method of the CodeEffects.Rule.Editor.Control .NET class. This parameter is required.