You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ With it, you configure:
11
11
* a set of rules to find the objects according to the filters configuration
12
12
* a set of objects to play with
13
13
14
-
once configured, you can start the filtering process so that JamRules selects the objects that match your criteria and calls a 'selected' and a 'not selected' functions on each of them.
14
+
Once configured, you can start the filtering process so that JamRules selects the objects that match your criteria and calls a 'selected' function on each of them, and call a 'not selected' function for the others...
15
15
16
16

17
17
@@ -21,7 +21,7 @@ As an object filter library, Jamrules is your best friend! Ideal for product con
21
21
22
22
[See JamRules in action](https://demo.intersel.fr/jamrules/tests/filterDocs.html) (source code in test/filterDocs.html)
23
23
24
-
# Get started with an example...
24
+
# How it works...
25
25
To run jamrules, you will have to:
26
26
* create a jamrules object,
27
27
* define the filter configuration
@@ -46,7 +46,7 @@ Some of the properties may be used in the filtering configuration to select the
46
46
47
47
Your objects needs to have a json definition, eg. :
48
48
49
-
```json
49
+
```javascript
50
50
let myobjects = [
51
51
{
52
52
"type":"mammal",
@@ -58,14 +58,15 @@ let myobjects = [
58
58
"name":"dog",
59
59
"color":"white"
60
60
},
61
-
...]
61
+
//and so on
62
+
]
62
63
```
63
64
64
65
Your objects may not have the same set of properties... Up to you to define in your rules how to select or not your objects...
65
66
66
67
## Add objects
67
68
68
-
Use the function addPropertyObjects of your rulesEngine to add your objects and the behavior of the selected and not selected objects by jamRules:
69
+
Use the function **addPropertyObjects** of your rules engine to add your objects and the behavior of the selected and not selected objects by jamRules:
69
70
70
71
```javascript
71
72
rulesEngine.addPropertyObjects(
@@ -81,7 +82,7 @@ Generally, the filtering configuration is driven by the status of checkboxes, ra
81
82
82
83
For example, for the property "color", you could set several checkboxes, each allowing to select a color as "red", "blue", "green", ...
83
84
84
-
To configure the configurator, we use the function 'rulesEngine.selectConfigurationPropertyValue'.
85
+
To configure the property values of the configurator, we use the function **selectConfigurationPropertyValue**.
0 commit comments