diff --git a/README.md b/README.md index cfabbfcd..7354ceaf 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ All node objects **must** have a unique `value`. This value is serialized into t | `checked` | array | An array of checked node values. | `[]` | | `disabled` | bool | If true, the component will be disabled and nodes cannot be checked. | `false` | | `expandDisabled` | bool | If true, the ability to expand nodes will be disabled. | `false` | +| `expandOnClick` | bool | If true, nodes will be expanded by clicking on labels. Requires a non empty `onClick` function. | `false` | | `expanded` | array | An array of expanded node values. | `[]` | | `name` | string | Optional name for the hidden `` element. | `undefined` | | `nameAsArray` | bool | If true, the hidden `` will encode its values as an array rather than a joined string. | `false` | @@ -104,6 +105,7 @@ All node objects **must** have a unique `value`. This value is serialized into t | `optimisticToggle` | bool | If true, toggling a partially-checked node will select all children. If false, it will deselect. | `true` | | `showNodeIcon` | bool | If true, each node will show a parent or leaf icon. | `true` | | `onCheck` | function | onCheck handler: `function(checked) {}` | `() => {}` | +| `onClick` | function | onClick handler: `function(clicked) {}`. If set, it will be called when clicked on a node label. | `() => {}` | | `onExpand` | function | onExpand handler: `function(expanded) {}` | `() => {}` | #### Node Properties diff --git a/examples/dist/index.html b/examples/dist/index.html index c4752a69..80248219 100644 --- a/examples/dist/index.html +++ b/examples/dist/index.html @@ -64,6 +64,16 @@

Large Data Example

The checkbox tree is capable of supporting a large number of nodes at once.

+

Clickable Labels Example

+

+ By default, clicking on the node label texts toggle the checkbox value. Providing an onClick property the checkbox will toggle + only when clicking on the checkbox and the provided function will be called when clicking on the node label text. +

+

+ When the onClick function is defined passing the expandOnClick property will expand the clicked node automatically. +

+
+