Skip to content

Commit

Permalink
Merge branch 'master' into EnhancedColumnFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
Jojoshua committed Mar 12, 2022
2 parents d7f1879 + 3ccc520 commit 9775ca7
Show file tree
Hide file tree
Showing 13 changed files with 19,230 additions and 3,554 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [3.7.4](https://github.com/kevinchappell/formBuilder/compare/v3.7.3...v3.7.4) (2022-03-11)


### Bug Fixes

* **textarea:** remove type attribute from textarea ([bc68b3f](https://github.com/kevinchappell/formBuilder/commit/bc68b3ff939b41cd888a231b73e8a2bb13b2ca5a))

## [3.7.3](https://github.com/kevinchappell/formBuilder/compare/v3.7.2...v3.7.3) (2021-07-13)


Expand Down
16 changes: 16 additions & 0 deletions docs/formBuilder/options/onAddOption.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,19 @@ const options = {
}
$(container).formBuilder(options)
```
## Example
To add additional data with specific options, for example, to use with business logic if selected, add additional properties to the optionTemplate object.

```javascript
const options = {
onAddOption: (optionTemplate, optionIndex) => {
optionTemplate.label = `Option ${optionIndex.index + 1}`
optionTemplate.value = `option-${optionIndex.index + 1}`
optionTemplate.minLevel = `min-level-${optionIndex.index + 1}`

return optionTemplate
}
}
$(container).formBuilder(options)
```
This will add an additional textbox for each option on the formbuilder for the user creating the form to enter.
8 changes: 5 additions & 3 deletions docs/formRender/actions/setData.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# `setData` action

Set formData without rendering or re-initializing formRender.
Set formData *without* rendering or re-initializing formRender.

## Usage
<pre><code class="js">const wrap = $('.render-wrap');
const formRender = wrap.formRender();
// then
wrap.formRender('setData', formData);
// or
formRender.actions.setData(formData)</code></pre>
</code></pre>

## Demo
<p data-height="300" data-theme-id="22927" data-slug-hash="MWrgyJV" data-default-tab="js,result" data-user="kevinchappell" data-pen-title="formRender: userData" class="codepen">See the Pen</p>
Loading

0 comments on commit 9775ca7

Please sign in to comment.